The British Prime Minister Theresa May says she will resign on Friday 7 June.
Mrs May says a leadership contest will begin in the following week. She will remain as leader until a replacement is selected.
She also says she has informed the Queen.
In an emotional statement in Downing Street Mrs May said she had "done my best" to honour the EU referendum result.
It would remain a matter of "deep regret" that she had been unable to deliver Brexit.
But a new PM was "in the best interests of the country", she said.
"I will shortly leave the job that it has been the honour of my life to hold.
"The second female prime minister, but certainly not the last.
"I do so with no ill will, but with enormous and enduring gratitude to have had the opportunity to serve the country I love."
As she left the podium, her voice cracked and she came close to tears.
A tearful Theresa May says serving as prime minister has been "the honour of my life", saying she is proud to have been the second female leader of the UK— BBC Breaking News (@BBCBreaking) May 24, 2019
Live updates: https://t.co/uYam3l51Iz pic.twitter.com/5apujgBm4f
The prime minister has faced a backlash from her MPs against her latest Brexit plan, which included concessions aimed at attracting cross-party support.
Andrea Leadsom quit as Commons leader on Wednesday saying she no longer believed it would "deliver on the referendum result".
Mrs May met Home Secretary Sajid Javid and Foreign Secretary Jeremy Hunt at Downing Street on Thursday where they are understood to have expressed their concerns about the bill.
In her statement on Friday, she said that in order to deliver Brexit, her successor would have to build a consensus in Parliament.
"Such a consensus can only be reached if those on all sides of the debate are willing to compromise," she said.
Mrs May, once a reluctant supporter of EU membership, who won the top job in the turmoil that followed the 2016 Brexit vote, steps down with her central pledges - to lead the United Kingdom out of the bloc and heal its divisions - unfulfilled.
She endured crises and humiliation in her effort to find a compromise Brexit deal that parliament could ratify, and bequeaths a deeply divided country and a political elite that is deadlocked over how, when or whether to leave the EU.
Mrs May's departure will deepen the Brexit crisis as a new leader is likely to want a more decisive split, raising the chances of a confrontation with the European Union and a snap parliamentary election.
The leading contenders to succeed Mrs May all want a tougher divorce deal, although the EU has said it will not renegotiate the Withdrawal Treaty it sealed in November.
More to come.
- BBC and REUTERS