"Ivan Rogers has resigned a few months early," a British government spokeswoman said. "We are grateful for his work and commitment over the last three years."
May now faces formal Brexit talks - likely to be among the most complicated negotiations in post-World War Two European history - without one of Britain's most accomplished EU experts.
"This weakens May's ability to get a good EU deal," said Charles Grant, Director of the Centre for European Reform think tank. "Ivan Rogers was one of the very few people at the top of the British government who understand the EU."
The resignation is the second by a senior British EU official in the wake of the referendum. Jonathan Hill quit as Britain's European commissioner in June.
Rogers 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.
In October, Rogers warned British ministers that the consensus was that a trade deal with the EU might not be done until the early to mid-2020s and that national parliaments could ultimately reject it, the BBC reported last month.
Opponents of British membership applauded the loss of Rogers, who they said was a Europhile, and said Britain needed a new set of officials to negotiate a clear break with the club Britain joined in 1973.
"If Mrs May were serious about leaving the EU she would have removed him long before," Gerard Batten, United Kingdom Independence Party's Brexit spokesman, said.
Rogers, appointed by Cameron as Britain's permanent representative to the EU in November 2013, formerly worked in Downing Street, the British Treasury, the European Commission and at Citigroup and Barclays Capital.
After Cameron lost the June 23 Brexit vote and resigned, Rogers drew criticism from some of Cameron's advisers in London for lacking ambition in the 2015 attempt to redefine Britain's relationship with the bloc.
Though Cameron eventually struck a deal with the EU in February 2016, campaigners on both sides of the referendum later admitted that it failed to enthuse voters and that it fell short of what Cameron had initially pitched.
Hilary Benn, chairman of parliament's Brexit committee, said a change in such a significant position was "not a good thing".
"This is a time for continuity and experience because this going to be a very complex, a very challenging, a very difficult negotiation," Benn told BBC radio.
"It's an absolutely vital job both conveying the British government's view to the other 27 members states but also honestly reporting back what he was picking up about the attitude of the other 27 towards the forthcoming negotiations."
May has said she will trigger formal Brexit talks by the end of March, ushering in two years of divorce talks.