Martin Mansergh, an adviser on Northern Ireland to three Fianna Fáil taoisigh who went on to serve as a senator, TD and minister of state, has died.

Mr Mansergh is understood to have passed away while in Western Sahara with a group other former Irish parliamentarians. He was 78.

Having served in the Department of Foreign Affairs, Mr Mansergh left the civil service to join Charles Haughey as an adviser on Northern Ireland and Anglo-Irish matters when Mr Haughey was taoiseach.

He remained with Mr Haughey during his years of opposition, serving as Fianna Fáil’s director of research and policy, during which time he edited a book of Mr Haughey’s speeches, entitled Spirit of the Nation.

He returned to government with Mr Haughey in 1987, and went to serve in a similar capacity for Albert Reynolds and later Bertie Ahern. He was a key figure in the peace process which eventually led to the IRA ceasefires and the Belfast Agreement.

In 2002, after more than two decades as a backroom adviser, he entered electoral politics for Fianna Fáil standing for the Dáil in his ancestral home of Tipperary South. He was unsuccessful but was later elected to the Seanad, and in 2007 took a Dáil seat for the party.

He was made a minister for state in 2008, and served in a number of departments until Fianna Fáil was ejected from office in 2011, when he lost his Dáil seat.

From a Protestant Anglo-Irish family with farmland outside Tipperary town, and educated in Oxford University – his father was the distinguished historian Nicholas Mansergh – Mansergh was a singular figure in Irish politics.

Parts dotty professor, razor sharp political strategist, rural TD and highbrow intellectual, he was popular and respected not just in his own party but across the political divide, and his contribution to achieving peace in Northern Ireland is recognised as pivotal by all sides.

He is survived by his wife Elizabeth, and by his five children.