Peter Robinson: Profile of departing first minister of Northern Ireland
When Peter Robinson became first minister of Northern Ireland in 2008, Sinn Féin's Martin McGuinness said Stormont's "honeymoon period" was over.
As a founder member of the Democratic Unionist Party (DUP), Mr Robinson had spent almost 30 years in Ian Paisley's shadow before taking over the top job.
But his relationship with his partners in government was a colder affair.
During his tenure, it looked many times like the DUP's so-called "love-in" with Sinn Féin was heading for a divorce.
For much of his career, Peter Robinson emulated the uncompromising, hardline unionism of his mentor - the late Ian Paisley.
But he is likely to be remembered as a shrewd political strategist who helped to build the DUP into the biggest political party in Northern Ireland, before laying the ground for its historic power-sharing agreement with its once sworn enemies, Sinn Féin.
Born in Belfast in 1948, Peter David Robinson was educated at the city's Annadale Grammar school and then what is now Belfast Metropolitan College, before taking a job as an estate agent.
His decision to swap 'for sale' signs for election posters was made in 1971, just as the Troubles in Northern Ireland were reaching their height.
The IRA murder of his former school friend, 23-year-old Harry Beggs, spurred the young estate agent to join Ian Paisley's DUP.
By 1979, Mr Robinson had won his first Westminster election, becoming East Belfast MP, a seat he would hold for the next 30 years.
He became deputy leader of the DUP in 1980 and played a leading role in the 'Ulster Says No' campaign against the 1985 Anglo-Irish Agreement, which gave the Republic of Ireland a consultative role in Northern Ireland's affairs.
As part of the DUP's anti-agreement protest, Mr Robinson led an "incursion" over the Irish border in 1986, when he and 500 loyalists entered the County Monaghan village of Clontibret.
He ended up in a Republic of Ireland court, where he pleaded guilty to unlawful assembly and paid a fine.
There was further controversy later that year, when Mr Robinson was photographed wearing a beret at a rally of the paramilitary Ulster Resistance movement.
In addition to the Anglo-Irish Agreement protest, the DUP also fiercely opposed the 1998 Good Friday Agreement, refusing to share power with Sinn Féin until the republican party agreed to support the Police Service of Northern Ireland (PSNI).
The once-unthinkable happened in 2007, when the famous firebrand Ian Paisley went into government with former IRA man turned politician, Martin McGuinness.
But while Mr Paisley struck up an unlikely friendship with the deputy first minister, earning the pair the nickname, the Chuckle Brothers, Mr Robinson appeared to have a fractious relationship with Mr McGuinness.
Disputes over flags, parades, welfare reform, as well as past and present paramilitary activity threatened to bring down the power-sharing institution on several occasions during his tenure.
Mr Robinson also stepped aside twice as first minister - firstly to clear his name in a business scandal involving his wife, Iris Robinson, when her extra-marital affair with a teenage cafe owner was exposed in 2010.
A BBC Spotlight investigation revealed that Mrs Robinson, who was also an MP, MLA and councillor, had obtained £50,000 from two property developers to help her teenage lover, Kirk McCambley, launch his cafe business in south Belfast.
She tried to kill herself after the affair ended and resigned from politics for health reasons shortly before the scandal became public.
An inquiry later cleared Mr Robinson of allegations of wrongdoing - namely that he had been aware of the £50,000 payments but failed to inform the authorities.
However, he was politically damaged by the scandal and in the 2010 general election, he lost the Westminster seat he had held since 1979 to the Alliance MLA Naomi Long.
Although many critics expected him to resign at that stage, the DUP leader weathered his personal and political storms and led his party to victory in the 2011 Northern Ireland Assembly elections.
Ever the pragmatist, later that year he said the DUP needed to reach out to Catholic voters in order to guarantee the long-term security of Northern Ireland's place within the UK.
He spoke of the need to end sectarianism, and made significant gestures that would once have been considered unacceptable for a DUP leader - such as attending a Catholic funeral Mass and a Gaelic Athletic Association (GAA) football match.
However, it was religious tensions of a different kind that led to Mr Robinson making a public apology in June 2014.
He defended a Christian pastor who had described Islam as "heathen" and "satanic", and who said he did not trust Muslims.
Mr Robinson faced criticism for saying that he personally would not trust Muslims involved in violence or those devoted to Sharia law, but would "trust them to go to the shops" for him.
The DUP later visited Muslim community leaders at Belfast Islamic Centre and apologised in person for his remarks.
A heart attack in May 2015 forced Mr Robinson to spend some time in hospital, but he was not replaced as first minister.
He was back in the public eye within days, blaming his health problems on his poor diet and lack of exercise.
Over the summer recess, he was forced to defend himself in a fresh financial scandal, after allegations that a politician or party from Northern Ireland stood to profit from the largest property deal ever made in Northern Ireland.
Mr Robinson denied any wrongdoing over the sale of the National Assets Management Agency's Northern Ireland property loan portfolio and robustly defended himself at a Stormont inquiry into the deal.
In September 2015, the first minister stepped aside for a second time, this time in protest after Sinn Féin's northern chairman Bobby Storey, was arrested by police investigating the murder of ex-IRA man Kevin McGuigan just weeks earlier.
Mr Storey was later released without charge.
Mr Robinson resumed his post after an independent assessment of paramilitary activity in Northern Ireland concluded that the IRA's so-called 'army council' still existed but had a "wholly political focus".
During his time as first minister, Mr Robinson often spoke of his frustration with the political system at Stormont and the length of time it took to get anything done.
He described the current structures as "not fit for purpose" and called for significant reform.
The tensions between the DUP and Sinn Féin during his tenure led critics to claim that the two biggest parties were involved in a "sectarian carve-up" rather than carving out a shared future for unionists and nationalists.
Whether or not the latest Stormont deal will fix the problems that dogged Mr Robinson's time in office is yet to be determined.