White House press secretary Karoline Leavitt will leave her role at the end of August, President Donald Trump announced Wednesday.

The imminent departure of one of the president’s closest allies inside the White House marks a major shakeup for the president’s press operation, with less than three months until the midterm elections.

Describing her as “one of my most trusted aides,” Trump said in a social media post that Leavitt “will be departing her role at the end of the month so she can spend more time with her beautiful young children and family, a decision I totally understand and respect!”

Leavitt, he added, will continue to serve as an outside adviser.

The departure comes at a challenging moment for Trump, who’s facing low approval ratings amid the ongoing war with Iran and high gas prices, with most Americans saying he hasn’t paid enough attention to the country’s most important problems.