Will giving a time limit to her premiership help or hinder the PM?

media captionTheresa May: "I think it is right that the party feels the party would prefer to go into that election with a new leader"

Theresa May has survived a no confidence vote from her own MPs, but at the price of putting a time limit on her premiership.

The prime minister told MPs she will not lead the party into the next general election - scheduled for 2022 - but would stay on in the meantime to deliver Brexit.

Mrs May's pledge may have helped secure her immediate future - she can't be challenged in the same way by MPs for a year - but the long term is far from certain.

Does her concession strengthen her hand for the difficult months ahead or is a swift departure now inevitable?

And how did other prime ministers in similar situations fare?

David Cameron: The kitchen confession

media captionDavid Cameron told James Landale he would not be running for a third term

David Cameron was approaching the end of his first term as prime minister when he decided to announce he would not be running for a third.

What he said: Speaking to the BBC's James Landale in his kitchen as the 2015 general election approached, Mr Cameron said: "I think I'm standing for a full second term... the third term is not something I'm contemplating."

Why did he say it? He was asked if he would be serving the full five years if he won the election. His answer? "Terms are like Shredded Wheat - two are wonderful but three might just be too many." He didn't want to go on forever, but his announcement shocked many of his MPs and led to some accusations of arrogance from the opposition.

What happened next? The Conservative party won the 2015 election with a 12-seat majority, leaving behind its coalition government with the Lib Dems. But come the morning after the EU referendum in 2016, Mr Cameron resigned over the result - having called the referendum and campaigned for Remain.

So how long did he last? Between announcing his intentions and resigning, Mr Cameron lasted one year and three months.

Tony Blair: The curry house plot

image source, Getty Images
image captionTony Blair left Downing Street for the last time on 27 June 2007

Labour prime minister Tony Blair had been leading the country for nine years when he announced his plan to pass on the baton.

What he said: In September 2006, Mr Blair said: "The next party conference in a couple of weeks will be my last party conference as party leader... but I am not going to set a precise date now."

Why did he say it? His announcement was long-awaited by many in the party, having revealed in 2005 he would fight the election but then step down after a full term.

This led to growing animosity in Labour, as there had long been a rumour his eventual successor - then-Chancellor Gordon Brown - had been promised a chance at the top job at an earlier date.

In 2006, Mr Brown's supporters acted in what became known as the "curry house conspiracy" - a coup to remove Mr Blair and install the chancellor as prime minister.

The plotters, reportedly masterminded by then defence minister Tom Watson, had met over a biryani at a Wolverhampton curry house.

There they discussed Mr Blair's future, before circulating a missive calling for him to quit.

The letter leaked to the press and led to several of the plotters' resignations - but it did pile the pressure on Mr Blair to come up with a date.

What happened next? The BBC's political editor at the time, Nick Robinson, said there was still a lot of "poison" emanating from Labour MPs - and allies of Mr Blair and Mr Brown were continuing to fight behind the scenes.

So how long did he last? He resigned nine months later on 27 June 2007.

Gordon Brown: A desperate coalition pitch

image captionGordon Brown and his wife Sarah at the Labour Party conference

The May 2010 general election resulted in a hung parliament. Before the Conservative and Liberal Democrat coalition finally formed, Labour and the Lib Dems were in talks about a possible deal.

What he said: Less than a week after the election, Gordon Brown announced he would stand down as Labour leader in September of that year.

Mr Brown's announcement was seen as a desperate attempt by some to shore up a potential coalition.

The PM said Britain had a "parliamentary and not presidential system" and said there was a "progressive majority" of voters.

He said if the national interest could be best served by a coalition between the Lib Dems and Labour he would "discharge that duty to form that government".

But he had also failed to return a Labour majority to the Commons.

What happened next? Just a day later, it was clear his attempts hadn't worked and the Lib Dems would be choosing the Conservatives as their coalition partners.

Standing outside No 10, he said he had "loved the job" and, accepting his fate, wished the next prime minister well.

So how long did he last? One day.

What does this mean for Theresa May?

History suggests Mrs May will struggle to stay until her self-declared departure date.

Dr Matthias Dilling, a lecturer in politics from Oxford University, said she would not be able to prevent potential successors vying for the Tory leadership.

"Usually I would say it is probably difficult to stay on as long as she has announced," he said.

"But what is helping her now is that 'prime minister' is not a particularly appealing job for people to take over at the moment."

However, if Mrs May manages to get her Brexit plan through Parliament and the UK leaves the EU in March 2019, the picture could change rapidly.

How much longer she survives after that date "depends on the type of Brexit we're having", Dr Dilling said. "That's quite difficult to predict."

In the meantime, she faces potential successors plotting takeover plans and recruiting allies.

Dr Dilling said the PM could counter this by identifying credible contenders and getting them on side.

But that might not be possible until the pack of potential candidates narrows, he said.

image source, Getty Images
image captionA number of potential successors are being discussed in Westminster, including Boris Johnson, Amber Rudd and Dominic Raab

Lance Price, who was a special adviser to Mr Blair during his premiership, said it was important Mrs May found a candidate who could continue her Brexit strategy.

Mr Price said in the past leaders would claim to be "above the fray" in order to avoid (at least public) involvement in choosing a successor.

"She's got too much at stake for that," he said. "Until Brexit is sorted, her position is strengthened. As soon as it's sorted, she is then the lame duck prime minister."

She must build up a successor herself, he explained, but not so soon that they become a rival.

The psychological impact on the prime minister and her team will also be difficult to handle, Mr Price said.

"Under normal circumstances that would be pretty soul destroying.

"But she is living day by day, hour by hour. And she is used to being rebuffed constantly.

"She's never had a honeymoon period as a prime minister. So she's not a normal prime minister in that respect."

More on this story