LONDON — Hard-liners in Britain’s governing Conservative Party have so dominated debate over withdrawal from the European Union for the past two years that when they called last week for the overthrow of Prime Minister Theresa May, failure did not occur to them as a possibility.

But on Tuesday the so-called coup against Mrs. May was halted — for now, anyway — after the plotters admitted having been misled by their own supporters, who had melted away.

The setback for the hard-liners is some rare good news for Mrs. May, who is fighting for her political life, battling to quell a rebellion within her party and her cabinet over draft plans for a withdrawal, or Brexit, that would maintain some close ties to the European Union.

Those who want a no-confidence vote in Mrs. May need letters of support from 48 Conservative lawmakers, and their struggle to assemble that number has been portrayed as symptomatic of the incompetence of many hard-line Brexiteer proponents, including those in government, several of whom have quit the cabinet.