Image caption Barra McGrory rejected suggestions by some MPs and national newspapers that he could not be impartial

Northern Ireland's director of public prosecutions has confirmed that he is stepping down from the post.

Barra McGrory QC told Public Prosecution Service (PPS) staff he would resign later this year.

He will stay in post until a successor is appointed by the attorney general, a move that is expected in the autumn.

Mr McGrory became the first Catholic to hold the post when he was appointed in November 2011.

He said it had been an "honour" to lead the Public Prosecution Service and the "highest privilege of my professional career" to have served as director.

"I have enjoyed working with a tremendously talented team within the PPS and I look forward to continuing this important work until my term in office ends later this year," he said.

In recent months he has been in the eye of a political storm for prosecuting former soldiers for killings during Northern Ireland's Troubles.

His appointment five-and-a-half years ago ruffled the feathers of some unionist politicians.

As one of Northern Ireland's best known criminal lawyers he had represented Sinn Féin's Gerry Adams, Martin McGuinness and other senior republicans.

Mr McGrory pointed out that he had also represented loyalist paramilitaries, unionist politicians and former police officers.

Mystified

He has been strongly criticised by a number of Conservative Party MPs and the Democratic Unionist Party in recent months for decisions to prosecute former soldiers.

They claimed that cases involving soldiers were being unfairly prioritised.

There were even calls for him to be sacked.

Earlier this year, he told the BBC that those who accused him of treating former soldiers unfairly had insulted him and his office.

Mr McGrory said he was mystified by the claims that he did not act impartially when he brought charges against a small number of ex-soldiers.

It is understood he plans to return to his private legal practice.

Sources have said that his decision is not connected to the criticism he has faced in recent months.