President Trump made the surprise announcement on Twitter that Sanders will step down at the end of the month.
"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 said in a tweet on Thursday.
"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!" tweeted the US president.
Sanders, 36, has been a loyal mouthpiece, famously saying that God "wanted Donald Trump to become president".
Only the third woman to serve in the prestigious position, Sanders is the daughter of popular Republican politician and former Arkansas Governor Mike Huckabee. Later at a White House event, Trump praised Sanders.
"We've been through a lot together. She's tough, and she's good. You also have tough and bad, right? She's tough but she's good. She's great. And she's going to be leaving the service of her country and she's going to be going - I guess you could say the private sector but I hope she's going she comes from a great state, Arkansas.
"That's a state I won by a lot, so I like it. We love Arkansas. She's going to be going back to Arkansas with her great family. Her husband is fantastic, Trump said.
Her credibility was questioned during a combative tenure that saw press briefings all but relegated to a thing of the past.
She started out as deputy press secretary before replacing Sean Spicer in the top post in July 2017.
The outgoing White House Press Secretary said it was one of the "greatest jobs she could ever have".
"This has been the honour of a lifetime, the opportunity of a lifetime. I couldn't be prouder to have had the opportunity to serve my country, and particularly to work for this president.
"He has accomplished so much in these two-and-a-half years, and it's truly been something I will treasure forever. It's one of the greatest jobs I could ever have. I've loved every minute, even the hard minutes. I've loved it, Sanders said.
She praised Trump and his team.
"I love the president; I love the team that I've had the opportunity to work for. The president is surrounded by some of the most incredible and most talented people you could ever imagine, and it's truly the most special experience. The only one I can think of that might top it just a little bit is the fact that I'm a mom, Sanders said.
She vowed to "be one of the most outspoken and loyal supporters of the president and his agenda. I know he's going to have an incredible six more years and get a lot more done, like what we're here to celebrate today.
Sanders said, "I do not know, when asked if she is considering running for governor of Arkansas. "I learned long time ago never to rule anything out," she told the reporters.
Later talking to a group of reporters, Sanders said she wanted to spend time with her family and kids who are growing. She has three kids of seven, five and four years of age.
Early this year Indian American Raj Shah departed the White House as the Deputy Press Secretary.