Theresa May has promised to set a timetable for the election of her successor after the next Brexit vote in the first week of June.
The agreement follows a meeting between the prime minister and senior Tory MPs who are demanding a date for her departure from Downing Street.
If she loses the vote on her Brexit plan, already rejected three times, sources tell the BBC she would resign.
Meanwhile, Boris Johnson has said he will run for leader once Mrs May goes.
Mrs May survived a confidence vote of Conservative MPs at the end of last year and existing Conservative rules mean she cannot formally be challenged again until December.
But the prime minister has come under increasing pressure to leave Downing Street this summer, amid the Brexit impasse and poor results for the Conservatives in the recent local elections in England.
The BBC’s political editor Laura Kuenssberg said senior sources had told her it was “inconceivable” the prime minister could remain in office if MPs rejected her Brexit plans for a fourth time.
PM’s future hinges on next Brexit vote
“Discussing an election timetable” doesn’t sound that exciting.
But the paragraph tucked into the short formal letter from Sir Graham Brady to Tory MPs all but marks the end of Theresa May’s premiership and the beginning of the official hunt for the next leader of the country.
After the lines in the short note restate the prime minister’s determination to get Brexit done, it confirms in black and white that after the next big vote, in the first week of June, the prime minister will make plans with the party for choosing a successor.
Right now, the expectation is that vote will be lost (although it is not impossible, of course, that Number 10 could turn it round).
And the conversation that’s been arranged won’t just be a gentle chat about what to do next.
Senior sources have told me that means, even though the letter doesn’t spell it out, that if her Brexit plan is defeated again, Mrs May will announce she is going.
The chairman of the 1922 committee of Conservative MPs, Sir Graham Brady, said he had reached an agreement over the prime minister’s future during a “very frank” meeting in Parliament.
He said the committee’s executive and Mrs May would meet again to discuss her future following the first debate and vote on the Withdrawal Agreement Bill in the week beginning 3 June.
Sir Graham said there was now “greater clarity” about the situation.
Asked if that meant the prime minister would quit immediately if MPs rejected her Brexit plans once more, he said that scenario went “beyond” what had been agreed.
Former foreign secretary Boris Johnson has joined the growing list of Conservatives who say they will stand for leader when Mrs May announces her departure.
He told a business conference in Manchester: “Of course I am going to go for it.”
MPs have rejected the prime minister’s Brexit agreement with the EU three times.
But she will have another go in the week beginning 3 June, when the Commons votes for the first time on the EU Withdrawal Agreement Bill – legislation needed to implement her deal with the EU.
Last month, the 1922 Committee executive narrowly decided against changing the party’s leadership rules to allow an early challenge to Mrs May.
Pressure has grown on Mrs May since the Conservatives’ loss of more than 1,300 councillors in local elections two weeks ago.
Much of the anger in the parliamentary party is focusing on the prime minister’s talks with Labour, aimed at reaching a cross-party compromise to get her deal through the Commons.
Local Tory associations have confirmed they will hold a vote of confidence in her leadership on 15 June, although its result will not be binding.
But International Trade Secretary Liam Fox told BBC Radio 4’s Today programme the prime minister had shown “integrity” as she was willing to make a “personal sacrifice” to get her deal through Parliament.
He said the public had instructed MPs to deliver Brexit in the 2016 referendum, asking: “Why have they not carried it out?”
Labour leader Jeremy Corbyn said his party would not support the Withdrawal Agreement Bill unless it guaranteed membership of a customs union with the EU, and protected workers’ rights, consumer rights and environmental rights.
“Our view is there has to be a relationship with Europe that guarantees those things, and if that bill doesn’t do it, then we won’t support it,” he said.
Theresa May agrees to timetable to choose successor}