Britain's ambassador to the European Union, Ivan Rogers, has resigned less than three months before the UK begins formal negotiations to leave the bloc, drawing a mixed reaction from pro-EU and eurosceptic politicians.

Rogers, who has served as the British ambassador to the EU since late 2013, had been due to end his four-year stint in October.

"Sir Ivan Rogers has resigned a few months early as UK permanent representative to the European Union," a British government statement said.

It said Rogers had decided to resign to "enable a successor to be appointed before the UK invokes Article 50" of the Lisbon Treaty, which sets the rules for a two-year negotiating process for a nation leaving the EU.

His resignation comes less than a month after he came under fire for saying that a post-Brexit trade agreement with the EU could take up to 10 years.

Prime Minister Theresa May's spokesman then insisted a deal could be done within two years that would allow Britain to trade with and operate within the single European market.

Rogers' relationship with members of May's cabinet had reportedly deteriorated following the country's vote for Brexit in June.

He was known in London for sometimes blunt assessments of how far Britain could push EU allies, often expressed in long emails, that jarred with the expectations of some senior advisers around May and before her, David Cameron.

Mixed reaction

Opposition Labour lawmaker Hillary Benn, who chairs a parliamentary committee on Brexit, said Rogers' resignation was "not a good thing" and that the government must urgently replace Rogers.

"It couldn't be a more difficult time to organise a handover," Benn said.

But Suzanne Evans, deputy leader of the anti-EU UK Independence Party, said the resignation was "excellent" news.

It leaves "an opening for a dedicated Brexiteer," Evans said on Twitter.

Arron Banks, chairman of the Leave.EU movement, said Rogers was "far too much of a pessimist and another of the establishment's old guard".

"It's time now for someone who is optimistic about the future that lies ahead for Brexit Britain," he said.

John Redwood, a leading Conservative eurosceptic, told the BBC Rogers had made a "wise decision" because he did not "really have his heart in" Brexit.

Aled Williams, the former spokesman for Britain's EU embassy, said Rogers' departure was a "big loss" to the Brexit negotiations.

READ MORE: Leaked memo says UK government has no plan for Brexit

In the June 2016 referendum, 52 percent voted for Britain to leave the EU.

May intends to trigger Article 50, giving formal notification of Britain's intention to leave the bloc, by the end of March.

This begins a two-year countdown after which Britain will leave all the institutions and the single market unless alternative arrangements have been agreed.