British Prime Minister Theresa May has issued a stark warning to lawmakers that if they do not back her Brexit deal, there is the possibility the country "will not leave the European Union (EU) for many months, if ever".

Her appeal comes after a chaotic week in parliament in which MPs twice massively rejected the Brexit deal May struck with EU leaders with just two weeks left before Britain is due to leave the bloc.

Writing in the Sunday Telegraph, May said that if MPs do back her deal before the European Council summit on Thursday, she would seek "a short technical extension" beyond the March 29 date to leave the EU.

Acknowledging it was "not an ideal outcome", May said "it is something the British people would accept if it led swiftly to delivering Brexit".

"The alternative if Parliament cannot agree the deal by that time is much worse," she said, with Britain likely having to take part in European elections in May if there was a longer extension.

"The idea of the British people going to the polls to elect MEPs three years after voting to leave the EU hardly bears thinking about.

"There could be no more potent symbol of Parliament's collective political failure," she wrote.

May warned that if MPs failed to back her deal before the European Council summit, "we will not leave the EU for many months, if ever".

The prime minister struck her agreement with the EU in November after nearly two years of tortuous talks following the June 2016 referendum to leave the bloc.

But the deal has remained deadlocked in parliament, chiefly by disagreement over the so-called Irish "backstop" — a measure to avoid barriers at the border between Northern Ireland and the Republic of Ireland.

Lawmakers voted against the deal for a second time on Tuesday but then voted against leaving the EU without a deal on Wednesday.

MPs also rejected a call to hold a second Brexit referendum — a blow to the hopes of a large number of Britons who still dream of keeping their European identity.

May needs to win over rebel Brexiteers in her own party and Northern Ireland's hardline Democratic Unionist Party which props up her government.