LONDON — Prime Minister Boris Johnson suffered a stinging defeat on Saturday as Parliament rebuffed his campaign to take Britain out of the European Union by the end of the month and forced him to seek an extension that he had vowed never to pursue.

The turbulent events left Mr. Johnson’s agreement in limbo and threw British politics once again into chaos, with any number of outcomes possible: a no-deal exit from the European Union, a second referendum on whether to leave at all, or a general election that could shift the balance in Parliament. The only sure result was continuing frustration and confusion among the British public.

Late on Saturday night, Mr. Johnson formally applied to the European Union, in an unsigned letter, for another extension of Britain’s departure, something he said he would rather be “dead in a ditch” than do.