BRUSSELS (Reuters) - Her back to the wall on Brexit, Theresa May turned to her legal adviser to rescue her deal with the EU - only to see Geoffrey Cox deliver it a mortal blow as parliament voted down the treaty for a second time.

Britain's Attorney General Geoffrey Cox gestures as he speaks in Parliament in London, Britain, March 12, 2019. UK Parliament/Mark Duffy/Handout via REUTERS

European Union officials familiar with the negotiations Cox conducted lately said the prime minister should not have been surprised. Cox has been a bullish star performer in London courtrooms but rubbed Brussels’ technocrats up the wrong way as he pursued what they saw as unrealistic demands for amendments.

Some in the EU accused the barrister, who unlike May had campaigned for Brexit in the 2016 referendum, of sabotaging a deal which many fellow Conservatives believe binds Britain too tightly to EU rules. Some in Britain commended him for sticking honestly to his legal guns, despite political pressure.

“Mr. Cox killed it all,” said Elmar Brok, a veteran EU lawmaker and confidant of German Chancellor Angela Merkel. “Because he is a Brexiteer, he wanted to kill it. There was no legal and political reason for what he did. He carries the responsibility,” Brok told Britain’s Sky News television.

By contrast, Sammy Wilson, the Brexit spokesman for May’s pro-Brexit Northern Irish parliamentary allies the Democratic Unionists, said: “Some people worried that (Cox) was marking his own homework. But he was honest - and we appreciated that.”

If May was peeved by Cox saying on Tuesday that commitments he had himself wrung from the EU were not enough to end a risk of Britain being trapped in EU rules after leaving the bloc, she gave little away. Cox just did his job in offering independent legal advice, aides to the premier insisted on Wednesday.

His earlier opinion, which lawmakers forced the government to publish in December, was that a “backstop” clause obliged Britain to maintain EU customs and economic rules until better ways were found to avoid a disruptive “hard” border between the EU and Northern Ireland. Many lawmakers cited that to justify rejecting by a huge margin May’s withdrawal treaty in January.

The prime minister then pledged to secure changes to the deal that would convince Cox to change his mind. To secure them, she despatched the attorney general himself to Brussels.

But after several weeks of his own shuttle diplomacy, and hours after May had declared herself satisfied with a tweaked package after a late-night dash to Strasbourg, Cox said on Tuesday that, despite some improvement, the legal risk remained that Britain might be unable to get out of the backstop.

CONFRONTATION, NOT COLLABORATION

EU officials familiar with Cox’s recent discussions with Michel Barnier’s team of Brexit negotiators said the blunt conclusion seemed in tune with a man whose manner, steeped in the adversarial oratory of the English bar, had disappointed - even offended - Brussels experts who had hoped for more a more collaborative approach to securing parliament’s ratification.

Where May had seemed willing to accept a mechanism by which Britain could seek to get out of the backstop conditions if the EU was being unreasonable, several diplomats and officials told Reuters, Cox pushed for complete freedom to opt out.

A former head of the European Council legal service, Jean-Claude Piris, said Cox’s goal appeared to breach international law by giving London a unilateral right to break a treaty.

“Barnier’s people were expecting to work on May’s demands,” one senior EU diplomat said. “Then Cox showed up with a completely different way and said ‘it’s my way or no way’.

“He was arrogant and patronising. Just a disaster.”

The publication on Sunday of an interview which Cox given days earlier to a British newspaper, also angered Brussels.

In it, he declared that his reputation as a trial lawyer for 36 years meant much more to him than that as a politician after just seven months as a minister. A comment about blocking any use of the backstop led some EU officials to conclude that he spent subsequent days negotiating on the terms in “bad faith”.

“This is what you get when you ask a criminal lawyer to give advice on EU law,” one EU diplomat said. “He comes here saying he has 36 years of experience and that we should educate ourselves. Outrageous from a man who then goes on to show he has very little idea on EU law, trade law, customs and all these other crucial but technical things he considers himself above.”

Cox, however, garnered praise at home for his legal integrity. Some commentators compared him favourably to a predecessor whose shift in advice to let a government wage war on Iraq dogged that attorney general in controversy for years.

And criticism from Brussels seems unlikely to worry a man whose terse response on Twitter to a media report that he was under orders to support May’s backstop deal was “Bollocks”.