London(CNN) After months of speculation, attempts to oust her and parliamentary defeats, the fate of Theresa May is finally sealed. But although there is clarity about her political career -- now she has announced she will resign on June 7 and set the timetable to elect a new Prime Minister -- the future of the Conservative Party, the government and the UK is far from clear.
All of this hinges now on who will be elected as May's successor and that person's position on Brexit.
The frontrunner is the former Foreign Secretary, Boris Johnson, the clear favorite among Conservative members who will ultimately elect a new leader -- but they'll only do so once two candidates are put forward for a runoff after a knockout contest by Tory lawmakers.
That contest will formally start after May resigns on June 7, although the race has already unofficially begun. Until then, May has two weeks to perform her duties as Prime Minister, including a major state visit by US President Donald Trump and his family in the first week of June, which will take in a State Banquet with the Queen, as well as D-Day commemorations.
Even though May's legacy, as the PM who failed to deliver Brexit, is already fixed, these final days will allow her to finesse that departure with some dignity.
In contrast to those ceremonial matters of state, a far dirtier, messier business is underway in Westminster: Conservative lawmakers fighting each other to be the next PM. Having been at each other's throats over Brexit, a leadership contest will likely deepen those divisions. The task for the new leader is to bring the party together again.
Johnson may have huge support among party grassroots, but his popularity among Tory MPs is more muted. According to the website conservativehome.com, the current Foreign Secretary, Jeremy Hunt, has the most supporters among MPs: 27, compared to 19 for Johnson. Hunt was instrumental in hastening May's departure by holding private talks with her on Thursday -- although he did not directly tell her to quit, he said she had no hope of passing her new compromise Brexit deal put forward earlier this week.
The new deal had been already widely criticized by lawmakers from all parties, including those normally loyal to the Prime Minister. After that, there was no way back for May.
While Johnson and Hunt may be the frontrunners, the contest is wide open, with more than 15 MPs having either already declared or planning to. In the Cabinet, Environment Secretary Michael Gove, a leading figure in the 2016 campaign to leave the EU but who has been loyal to May in trying to get her original withdrawal deal through the Commons, could bring together the different wings of the party.
Home Secretary Sajid Javid, who voted Remain but has tacked towards the Brexiteer wing in the past three years, and Defence Secretary Penny Mordaunt, a prominent Leave campaigner, are all strong contenders. Dominic Raab, who resigned as May's second Brexit Secretary last autumn because he could not support the withdrawal agreement that he played a part in agreeing with Brussels, is admired by Brexiteer lawmakers.
Among this wide field of contenders could stand a man or woman who could stop Johnson from making it through to the final run-off among party members. If that does not happen, the premiership is likely to be Johnson's.
This would be an extraordinary turnaround for a man whose record as Foreign Secretary, before he resigned last July, was patchy at best: he has been blamed for worsening the predicament of the jailed British-Iranian mother Nazanin Zaghari-Ratcliffe and often left diplomats and officials bemused or aghast while on foreign excursions.
Last August, weeks after his resignation, Johnson caused controversy by comparing Muslim women who wear face veils to letterboxes. It is this record which makes some of his Tory colleagues -- not to mention politicians across Westminster - deeply uneasy.
What's more, there are fears that the Conservative Party will elect a Brexiteer Prime Minister who would be happy for the UK to leave the EU without a deal -- something May tried to stop.
Some Brexiteer candidates may even push for a "managed no deal," arguing that May had been too soft on Brexit. While there is no majority in the House of Commons for a no-deal Brexit, because of the fears over the economic damage this could bring, this outcome will happen by default if there is no formal deal passed by October 31, the new Brexit date.
Even though the prime minister will change, the numbers in Parliament will not -- unless the new leader calls a snap election during his or her honeymoon period.
And beyond Westminster, it's not going to be an easy feat to change the existing withdrawal agreement without the approval of the EU. The EU Commission's official Twitter account tweeted on Friday: "The European Council stated on 10 April 2019 that there can be 'no opening of the Withdrawal Agreement'. It is the best and only deal possible."
The new prime minister will find dealing with an intransigent Brussels as difficult as his or her predecessor experienced.
May's successor, of whatever strand of Conservatism or stance on Brexit, will still have to get a deal through the Commons. That's a huge task. For Westminster and for the UK, there are still months of uncertainty ahead.