Prime Minister Theresa May of the United Kingdom on Friday announced her intention to resign.

May will quit as head of the governing Conservative Party on June 7, so she will still be in office when President Donald Trump pays a state visit June 3-5.

When she steps down, that will trigger the process of selecting her successor, who should be in place in July.

The field of potential successors is crowded, but the two front-runners are generally thought to be Boris Johnson, the former foreign secretary, and Dominic Raab, the former Brexit secretary, both of whom resigned over May’s handling of Brexit.

The Wall Street Journal reminded its readers that Johnson and Raab were not the only ministers to quit May’s Cabinet. “A fifth of all British ministers who have quit government since 1979 have done so during Mrs. May’s relatively brief tenure,” the paper noted.

In fact, the rebellions in both May’s Cabinet and her party during her tenure have been unprecedented.

The reason for May’s fall is simple.

She was given responsibility for negotiating Britain’s exit from the European Union, and she made a mess of it by arriving at an agreement that virtually no one in Britain likes. Her efforts to pass the agreement ended up trying to cut a deal with Jeremy Corbyn, the leader of the Labour Party and deeply despised by Conservative voters.

May was already floundering before she took that fatal step, but the effort to reach out to Corbyn and pass her deal over the heads of her own party triggered a catastrophic collapse in her support, which was felt in recent local elections.

It’s widely expected that the Conservatives will take a hammering in the ongoing European elections, potentially finishing as low as sixth. In her own party, 63% rate her as either a bad or a terrible prime minister.

In a quieter time, May could have been a good prime minister, but these are not quieter times. Her departure will come as a relief to much of her party.

It is the only way to ensure Brexit happens, and the best way to give the Conservative Party a chance to win the general election that her successor is likely to call in June 2020.

It also gives Britain its only chance to regain its freedom to make its own trade policy, which is an essential step if Britain and the United States are to negotiate a free-trade area. That’s a step The Heritage Foundation has advocated for years, and it’s there for the taking once Britain exits the EU.