The director of public prosecutions is to stand down at the end of her five-year contract, the government has said.

Alison Saunders will no longer be the head of the Crown Prosecution Service from October.

While at the CPS she oversaw justice finally being served in the case of murdered teenager Stephen Lawrence.

But in recent months she has faced criticism after several rape trials collapsed due to evidence not being disclosed.

Attorney General Jeremy Wright announced her resignation on Sunday evening and said recruitment for Ms Saunders' successor will begin later this month.

Ms Saunders, who will move to multinational law firm Linklaters, said the role had been a "tremendous privilege" and she was "proud of everything the service has achieved" over the past five years.

"My priority over the next six months is to keep driving improvements in how we work, with a sharp focus on casework quality," she said.

Ms Saunders joined the CPS as a barrister in 1986.

She was named chief crown prosecutor for London and in 2012 oversaw the successful prosecution of two men who killed Mr Lawrence.

The 18-year-old was stabbed to death in an unprovoked and racist attack as he waited at a bus stop in south-east London.

Ms Saunders is the second longest-serving DPP, after Dame Barbara Mills who served for six years in the 1990s.

In the 2013 New Year Honours, she was appointed a Companion of the Order of the Bath for services to law and order for her work particularly after the 2011 London riots.

Announcing she would be stepping down, Mr Wright thanked her for her service and called her an "accomplished CPS prosecutor whose successful record includes the prosecution of Stephen Lawrence's killers".

"I have no doubt that she'll be greatly missed within the organisation," he said.

Recent criticism

Concerns were raised about the justice system following the high-profile collapse of several rape trials because evidence had not been shared with defence lawyers.

At the time, Conservative MP and former lawyer Anna Soubry said she feared Ms Saunders was "part of the problem".

But the Daily Telegraph, in its front page story on Sunday, quoted an unnamed ally of Ms Saunders who said she had done a "pretty reasonable job" in the circumstances when "the amount of money available for the CPS is limited".

In December last year, two rape trials collapsed in one week and a third rape case collapsed in January.

According to figures, the number of prosecutions in England and Wales that collapsed because of a failure by police or prosecutors to disclose evidence had increased by 70% in the past two years.

It prompted the CPS to "urgently" launch a review into all current rape and sexual assault cases in England and Wales.