After 22 months on the job, Sarah Sanders, the combative White House press secretary whose tenure was marked by controversy and questions about her credibility, will be leaving.

President Trump shared the news of her unexpected departure in a tweet, writing: “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.”

He added: “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!”

Sanders, 36, has been among the longest-serving senior officials in Trump’s administration. During her rocky stint as the president’s official spokeswoman, Sanders endeared herself to her boss and to his supporters by her staunch defense of him and his remarks. She often amplified Trump’s criticism of the news media, pushing back on reporters’ questions, sometimes sarcastically.

Sanders made her devotion to the president plain in January when she told an interviewer for the Christian TV network CBN that “God wanted Donald Trump to become president.”

Controversy

Her truthfulness was called into question on several occasions, including by special counsel Robert S. Mueller III’s nearly two-year investigation of Russian interference in the 2016 election. Mueller’s report cites two occasions in May 2017 where Sanders told reporters that rank-and-file members of the FBI supported Trump’s firing of FBI director James B. Comey. But when asked about this description by investigators, Sanders backed off that charge. She told Mueller’s team that the first time she made that statement it was a “slip of the tongue” and that she repeated it later in a press interview and it “was a comment she made ‘in the heat of the moment’ that was not founded on anything,” according to the report.

Sanders’s time as press secretary is notable for what she didn’t do as much as for what she did. Under her watch, her principal function as press secretary — representing the White House in media briefings — all but ceased to exist. The White House set a record in January for the longest stretch in modern history without a news briefing, 41 days. It then set a record, 42 days, in March, followed by a third streak, reaching 94 days Thursday.

In recent months, Sanders’ primary public contact with reporters was on the White House driveway, where she would hold irregular and impromptu “gaggles,” usually after appearing on Fox News.

‘I am blessed and forever grateful’

Sanders floated leaving after the midterm elections but decided against it, according to people familiar with her thinking. The president often called Sanders in the morning to discuss news coverage of him, and the two would sometimes speak multiple times throughout the day.

Though she no longer briefed the media, she regularly attended meetings on foreign policy, trade and health care. She was at the table for many meetings with foreign leaders.

The terms of her departure were unclear, though Sanders told staff around 4 p.m. in her office that it was her choice, according to people with knowledge of her comments who spoke on the condition of anonymity to describe the private meeting.

Sanders also told aides that she couldn’t give a commitment through the campaign because of her family.

“I am blessed and forever grateful to @realDonaldTrump for the opportunity to serve and proud of everything he’s accomplished. I love the President and my job. The most important job I’ll ever have is being a mom to my kids and it’s time for us to go home. Thank you Mr. President!,” she tweeted Thursday afternoon.

While Trump floated the idea of Sanders running for governor of Arkansas in both his tweet and later during an event at the White House, it’s unclear how serious she is pursuing that idea. Republican Gov. Asa Hutchison’s term isn’t up until 2022.

A familiar presence in the White House

Sanders joined Trump’s presidential campaign as a senior communications adviser in early 2016 after managing the unsuccessful campaign of her father, former Arkansas Gov. Mike Huckabee (R). She served as a spokesman for Trump during the campaign; he appointed her the top deputy to Trump’s first press secretary, Sean Spicer, and she replaced Spicer after he resigned in July of 2017.

As such, she was a familiar presence in a White House beset by personnel turmoil and turnover. Trump has had seven communications directors during Sanders’ tenure.

In contrast to Spicer, who could grow visibly agitated under press questioning, Sanders initially drew praise from White House reporters for her calm and friendly manner. But those relations began to sour when she started to skirt questions on sensitive topics, sometimes sarcastically, by offering rote answers, such as “I haven’t spoken with the president about that” or offering to follow up later, only to neglect to do so.

While Sanders was well liked within the White House, she also conflicted at times with fellow aides.

Early in the administration, Sanders showed her mettle when a group of White House aides were gathered in Spicer’s office to discuss leaks to the media.

Stephen K. Bannon, then a senior White House adviser, defended a group of his loyalists who had been accused of the leaks. These young aides, Bannon railed, were “warriors” for Trump.

Finally, Sanders had heard enough. She stood from her perch on the couch to look Bannon in the eye and became visibly emotional.

“I’ll tell you who the warriors for Trump are,” Sanders said, recalled someone in the meeting, speaking anonymously to recall a private conversation. “The warriors are the folks like me who were there from the beginning, and are still fighting for him every day.”

Then, she turned and walked out.

Ashley Parker contributed to this report.

Trump said these four minority congresswomen should ‘go back’ to their countries. Then he dug in further.

In new tweets Monday, the president said the congresswomen should apologize

Ilhan Omar made history when she was elected to Congress. Here’s her story.

She’s at the center of a contentious fight over American identity

Sexual assault allegations against Trump’s nominee for military’s No. 2 officer complicate his confirmation

Senators have expressed concerns about how the Pentagon handled sexual assault allegations against him