Sir Ivan Rogers, who was not due to leave his post until November, announced he would be stepping down early.
Prime Minister Theresa May plans to trigger Article 50, the formal process for leaving the EU, by the end of March.
Sir Ivan, who was appointed to his role by David Cameron in 2013, is one of Britain’s most experienced diplomats on EU affairs.
While his resignation has been welcomed by Eurosceptics – who say it provides a clean break from the previous administration, his loss has been described by others as “a body blow”.
Sir Ivan sparked controversy last year after he privately warned the Government that a post-Brexit trade deal could take a decade to finalise and even then may fail to get approval.
He faced criticism from prominent Leave campaigners, who accused the “scarred” diplomat of “gloomy pessimism”.
Sir Ivan Rogers was appointed to Brussels in 2013 by the then PM David Cameron
But Downing Street came to his defence, arguing he was simply passing on the views of other EU nations and was “doing the job of an ambassador”.
Confirming his departure, a Government spokesman said: “Sir Ivan Rogers has resigned a few months early as UK Permanent Representative to the European Union.
“Sir Ivan has taken this decision now to enable a successor to be appointed before the UK invokes Article 50 by the end of March. We are grateful for his work and commitment over the last three years.”
Labour’s shadow Brexit secretary, Keir Starmer, called the resignation a “deeply worrying sign for Brexit negotiations that he has resigned”.
Mr Starmer said: “The Prime Minister needs to be far more willing to hear difficult truths. Having met recently with Sir Ivan, I am in no doubt his early resignation will be a real loss.”
Former UKIP Leader Nigel Farage welcomed Sir Ivan’s resignation and urged “a complete clear out” at the Foreign Office.