Media playback is unsupported on your device Media caption David Cameron: 'I don't want to be a distraction for Theresa May'

Former UK PM David Cameron has stood down as an MP, triggering a by-election in his Oxfordshire seat of Witney.

Mr Cameron, 49, who resigned as prime minister after June's EU referendum, said he did not want to be a "distraction" for new PM Theresa May

He said Mrs May had "got off to a cracking start", while she praised his "great strides" on social reform.

Mr Cameron, 49, has represented Witney since 2001, becoming Conservative leader in 2005 and PM in 2010.

Laura Kuenssberg: May's takeover now complete

Speaking in his constituency, he said it had been a "great honour" to be an MP for the area, but said it would be difficult for him to remain on the backbenches without becoming "a big distraction and a big diversion" from the work of the new government.

He denied his announcement was related to the government's moves towards allowing new grammar schools, a policy he rejected as PM.

He said the timing was coincidental, adding that there were "many good things" in the proposed education reforms.

Media playback is unsupported on your device Media caption Some of the highlights of David Cameron's years as the UK prime minister.

"Obviously I'm going to have my own views about different issues," he said.

"People would know that and that's really the point. As a former prime minister it is very difficult, I think, to sit as a backbencher and not be an enormous diversion and distraction from what the government is doing."

Analysis

Image copyright PA

By Laura Kuenssberg, BBC political editor

Friends say that David Cameron's decision has not been made in a fit of pique, he has not merely flounced out because he doesn't like what his successor is doing.

But there was a "very real danger", particularly because he does not support the UK leaving the European Union, that anything he said, any comment he made could "drive a real wedge" between him and the government which could make life harder for Theresa May.

It is not that surprising that the man who used to be in charge has decided to go.

But his departure adds to the sense that May's Downing Street feels more like a new administration after a general election than a continuation of David Cameron's tenure - "it IS a new government", one senior Tory told me, "not everyone has understood that yet".

Read more from Laura

Mr Cameron said Mrs May - his former home secretary - had been "very understanding" when he told her of his decision.

Asked about his legacy, and whether he would be remembered as the prime minister that took the UK out of the European Union, he said he hoped his tenure would be recalled for a strong economy and "important social reforms" and that he had transformed a Conservative Party that was "in the doldrums" into a "modernising winning force".

Image copyright Reuters Image caption David Cameron was joined by his family as he left Downing Street in July

Image copyright PA Image caption David and Samantha Cameron enjoying mussels on a Cornwall holiday in 2012

Image copyright Getty Images Image caption Mr Cameron and US President Barack Obama playing ping-pong in 2011

Mr Cameron won a 25,155 majority in 2015 in Witney, which has been held by the Conservatives since 1974.

He said he had not made any "firm decisions" on what to do next, adding that he wanted to continue to contribute to public life.

Mrs May said: "I was proud to serve in David Cameron's government - and under his leadership we achieved great things. Not just stabilising the economy, but also making great strides in delivering serious social reform."

She pledged to continue with his "one-nation government" approach.

David Cameron factfile

Aged 49

Born in London, educated at Eton and Oxford

First elected as MP for Witney in 2001

Was shadow education secretary before becoming Conservative leader in 2005

Led a coalition government from 2010 to 2015, winning an overall majority in 2015

Led the Remain campaign in the EU referendum

Ex-Chancellor George Osborne said he was sorry his "great friend" was stepping down.

"We came into Parliament together, had a great partnership and I will miss him alongside me on the green benches over the coming years," he added.

Labour leader Jeremy Corbyn said he wished David Cameron "all the best for the future", adding he got on well with him on a "human level".

Speaking at the TUC conference in Brighton, Mr Corbyn said: "We should respect people who move on to do something else with their lives. I want to wish him all the best for the future."

But Labour's Angela Eagle declined to add her voice to the tributes, telling the BBC Mr Cameron had "put his whole country at risk to settle a debate in his own party" through the EU referendum.

"He has now walked away leaving others to clear up the mess."

Ex-Lib Dem leader Nick Clegg, who was deputy prime minister in coalition, said Mr Cameron had shown "great skill" in negotiating and listening to other views during their time in government.

Mr Clegg's successor as Lib Dem leader Tim Farron added: "He has lots of things that he should be proud of but sadly his legacy will be one of accidentally removing us from our closest friends and neighbours in Europe."

Image copyright PA Image caption A high profile 2006 visit to the Arctic helped 'modernise' the party's image

Image copyright PA Image caption A keen cyclist - this was the day he became Conservative leader in 2005

Former cabinet minister Ken Clarke told the BBC: "I'm a friend of David's, so I regret to say, I think for history his legacy will be he's the man who accidentally caused Britain to leave the European Union.

"There's no getting away from the fact that that will overshadow every other feature of his premiership."

Mr Cameron initially became prime minister in coalition with the Liberal Democrats, before securing an overall majority in 2015.

He pressed ahead with his pledge to hold a referendum on the UK's EU membership - campaigning hard for a Remain vote and warning of the economic and security consequences of Brexit.

Media playback is unsupported on your device Media caption Members of David Cameron's Witney constituency react to his resignation

But he finished on the losing side, announcing his resignation the day after the vote, saying outside Downing Street that "fresh leadership" was needed.

At the time, he said he would continue as an MP until the next general election.

The last prime minister to resign, Gordon Brown, remained in the Commons for five years after his general election defeat in 2010, while Tony Blair stood down as an MP when he resigned as PM.