Mr Purcell made the decision to step aside as secretary general following three meetings with Justice Minister Frances Fitzgerald since she received a review of the running of the department earlier this month.

Mr Purcell was afforded time to consider the findings of the review, which found that there was significant management failures and a lack of accountability and transparency.

He will move to a different section of the civil service once a replacement has been recruited, and will maintain the same pay, terms and conditions.

Ms Fitzgerald insisted there was “no secret deal” arranged with Mr Purcell, who she said “took the right decision”.

However, the opposition warned he should not be allowed to walk away without answering questions about events leading up to the resignation of the former Garda commissioner, Martin Callinan, in March.

“The public is still unaware of what was said between Mr Purcell and the Taoiseach the night before the former commissioner resigned his post. This is unacceptable,” said Fianna Fáil’s Niall Collins.

Sinn Féin’s Pádraig MacLochlainn said the public must not be kept in the dark about what happened on the “infamous night” when Mr Purcell was dispatched by Enda Kenny to Mr Callinan’s home.

Mr Purcell refused to answer questions on the sequence of events at the Oireachtas Justice Committee in May.

Ms Fitzgerald said he will be available to give evidence to inquiries examining garda issues. She was speaking after publishing the review which was ordered following the Guerin report into the handling of allegations of Garda malpractice by whistleblower Sergeant Maurice McCabe.

It said there was a “closed” and “silo-driven” culture and secrecy had permeated the department so much so that it was “part of its DNA”.

The report said there were some “core strengths” in the department and noted it had been stretched by increasing work load and staff cuts.

However, it found a lack of leadership, no clear ownership of issues, a lack of accountability, and poor document tracking and media engagement.

It said management was unable to see where things went wrong and under-performance was not addressed.

Commenting on recent events — namely the issues examined in the Guerin report — it said there had been “serious leadership and management failures”, particularly in the department’s Garda Division.

It said this included the question of “how briefings of the minister and senior management were handled”. This appears to be a reference to the failure by department officials to formally brief former minister Alan Shatter about a key letter sent to Mr Callinan.

Ms Fitzgerald said the problems in the department “didn’t emerge overnight” and the report would provide a roadmap for reform.

In a speech to the MacGill Summer School last week, the secretary general of the Department of Public Expenditure and Reform, Robert Watt, said it should be easier to sack senior civil servants.