Sarah Sanders has been widely criticized for her performance in the White House.

President Donald Trump on Thursday made the surprise announcement of the departure of spokeswoman Sarah Sanders, who has been widely criticized for her performance in the White House.

"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, adding that he hoped she would run for governor of her state.

Sanders has been one of Trump's most loyal foot soldiers, almost constantly at his side during his tumultuous White House tenure.

However, she has a combative, sometimes bitter relationship with the White House press corps and is seen as responsible for the demise of the formal daily briefing -- practically an institution under previous presidents.

The last time she took to the podium for a back-and-forth with reporters in the White House briefing room was March 11. Instead, she communicates largely through interviews on the president's favorite TV network Fox News and short, informal briefings with other journalists outdoors.

She has also been accused of telling lies to reporters, although she denies this.

Despite Sanders' damaged reputation in media circles, there'd been no hint from the administration that her exit was imminent.

Sanders' father Mike Huckabee is a former Republican governor of Arkansas.