Rep. Ted Lieu (D-Calif.) blasted President Trump for forcing Defense Secretary James Mattis out two months earlier than his planned departure.

"How to describe this?" Lieu, a frequent Trump critic, tweeted on Sunday. "PETTY, WEAK, JUVENILE."

Lieu's tweet came moments after Trump tweeted that his choice for acting Defense secretary would take over on Jan. 1.

Trump is tapping Deputy Secretary of Defense Patrick Shanahan to replace Mattis as acting Pentagon chief.

"I am pleased to announce that our very talented Deputy Secretary of Defense, Patrick Shanahan, will assume the title of Acting Secretary of Defense starting January 1, 2019," Trump tweeted. "Patrick has a long list of accomplishments while serving as Deputy, & previously Boeing. He will be great!"

Mattis submitted his resignation last week, saying that he would step down at the end of February.

In a resignation letter that served as a rebuke of Trump's foreign policy, Mattis told Trump that he deserved a secretary "whose views are better aligned with yours."

The resignation came after Trump announced his plan to withdraw troops from Syria, which has drawn opposition from Pentagon officials and lawmakers.

Though Trump originally praised Mattis in a tweet after he announced his departure, the president later took a swipe at the Defense secretary before moving to accelerate his departure.