British Prime Minister Theresa May departs 10 Downing Street in London December 20, 2017 | Leon Neal/Getty Images Andrew Adonis quits, attacks May ‘the voice of UKIP’ The Labour peer described Brexit as ‘a dangerous populist and nationalist spasm worthy of Donald Trump.’

LONDON — A Labour peer resigned Friday from his role advising the U.K. government on infrastructure policy criticizing Theresa May's approach to Brexit.

Andrew Adonis, a transport secretary in the last Labour government, accused the U.K. prime minister of becoming the "voice of [the U.K. Independence Party]” in her Brexit policy, according to the Daily Telegraph, which obtained a copy of his resignation letter.

Adonis later tweeted an endorsement of a different version of the letter from Sky News Political Editor Faisal Islam. It said: “The European Union withdrawal bill is the worst legislation of my lifetime.”

“Brexit is a populist and nationalist spasm worthy of Donald Trump,” the letter went on.

“After the narrow referendum vote, a form of associate membership of the EU might have been attempted without rupturing Britain’s key trading and political alliances. Instead by allying with UKIP and the Tory hard right to wrench Britain out of the key economic and political institutions of modern Europe, you are pursuing a course fraught with danger.”

He warned the prime minister he would "relentlessly" oppose the European Union (Withdrawal) Bill in the House of Lords.

The legislation to translate EU law into U.K. law will be considered by the House of Lords, where Adonis sits as a Labour peer, early next year.

Adonis, who was appointed chair of the National Infrastructure Commission in October 2015, travelled to Brussels in November with former Deputy Prime Minister Nick Clegg and Conservative pro-European Union MP Kenneth Clarke to meet Michel Barnier, the EU’s chief Brexit negotiator.

Afterwards, he tweeted: "Clear from discussions in Brussels on Monday that U.K. can stop process of leaving EU whenever it likes before end March 2019. We should do so."

A U.K. government official said: "He’s been moving closer to the exit door with each new onslaught he makes against Brexit. He’s now walked through the door before he was pushed."

This article has been updated with details of the resignation letter as tweeted by Andrew Adonis.