The US ambassador to Qatar said Tuesday she is resigning her post in Doha amid the worst diplomatic crisis involving Washington’s Persian Gulf allies in years.

“This month, I end my 3 years as US Ambassador to #Qatar. It has been the greatest honor of my life and I’ll miss this great country,” Dana Shell Smith tweeted Tuesday.

Shell Smith did not explain why she was stepping down, if she will remain in the diplomatic service or who would replace her, Agence France-Presse reported.

Many US ambassadors leave their posts after serving about three years.

But Shell Smith previously appeared to slam the Trump administration after the president sacked FBI Director James Comey.

“Increasingly difficult to wake up overseas to news from home, knowing I will spend today explaining our democracy and institutions,” she tweeted on May 9.

Last week, Trump lashed out at Qatar, demanding that it stop funding terrorism shortly after Secretary of State Rex Tillerson urged other Gulf nations to end their blockade of the tiny, oil-rich emirate.

“The nation of Qatar, unfortunately, has been a funder of terrorism at a very high level. The time has come to call on Qatar to end its funding,” Trump said last week.

Qatar strongly rejects the allegations.

Saudi Arabia, the United Arab Emirates, Egypt and Bahrain severed diplomatic and economic ties with ­Qatar over longstanding allegations that the country was courting Iran and fomenting instability in the ­region.

Qatar is home to a vital US military outpost, the Al-Udeid Air Base, which houses 10,000 troops.

The Pentagon has said that while the blockade was not affecting current operations against ISIS, it was “hindering” the ability to plan for the long term.

Qatar paid $2.5 million to hire a lobbying firm run by former Attorney General John Ashcroft to audit its efforts at stopping terrorism funding, CBS News reported.

With Post wires