WASHINGTON — White House press secretary Sarah Sanders is leaving her post at the end of June, President Donald Trump said Thursday.

"After 3 1/2 years, our wonderful Sarah Huckabee Sanders will be leaving the White House at the end of the month and going home to the Great State of Arkansas," Trump tweeted, including the time Sanders worked on his campaign in addition to her service during his first two-plus years in office.

"She is a very special person with extraordinary talents, who has done an incredible job! I hope she decides to run for Governor of Arkansas — she would be fantastic. Sarah, thank you for a job well done!"

At a White House event minutes later, Sanders said she would “try not to get emotional, because I know crying can make us look weak sometimes.”

"[Trump] has accomplished so much in these two-and-a-half years, and it has truly been something I will treasure forever ... " she said, her voice cracking. "I have loved every minute, including the hard minutes.”

Sanders' tenure at the White House was marked by contentious public confrontations with the media over the president's agenda and her own misstatements, as well as a diminishing number of official briefings for the press. She has not briefed the media for 94 days — since March 11 — more than double the previous longest dry stint of the Trump administration.

In May 2017, she told reporters that "countless" FBI officials had told her that they had lost confidence in then-FBI Director Jim Comey — a comment that suggested the president had good reason to fire him other than the Russia investigation. Special counsel Robert Mueller later reported that Sanders acknowledged she had no evidence for the claim.

It was one of many occasions on which journalists questioned the credibility of Sanders' assertions from the White House podium.

But Sanders could also act as a ready and reliable conduit for information behind the scenes with some of the same outlets she clashed with in front of television cameras.

A daughter of former Arkansas Gov. Mike Huckabee, Sanders, 36, became a surrogate for Trump on television during his 2016 campaign for the presidency and joined his White House team in January 2017 as a deputy assistant to the president and deputy press secretary. She was promoted into the press secretary role in July 2017, succeeding Sean Spicer.

Arkansas Gov. Asa Hutchinson, a Republican, was re-elected in 2018 and cannot seek re-election in 2022. Sanders has not announced any plans to seek office.