Before he flipped his lid on Twitter, President Trump was warned by his wife and advisers to play it cool in response to his former aide Omarosa Manigault Newman’s charges that he had used the N-word and was mentally unfit for office.

First lady Melania Trump and the president’s other advisers knew the commander-in-chief would likely be unable to control his rage, but they gave it a shot anyway, Axios reported.

Newman, promoting her new tell-all, “Unhinged,” on multiple network and cable outlets, has for days painted an unflattering portrait of the president, saying he barely grasped the basics of his job, lied repeatedly and was in her opinion a racist.

Several advisers warned the president that by responding, he would only give her more free publicity and boost sales of her book, the website reported.

But Trump, who hired Newman to star on his show “The Apprentice” and then gave her a nearly $180,000 job at the White House as his liaison to the African-American community, remained true to his rep as a “counter-puncher.”

“When you give a crazed, crying lowlife a break, and give her a job at the White House, I guess it just didn’t work out. Good work by General Kelly for quickly firing that dog!” he tweeted, again prompting charges that he once again singled out a prominent African-American for criticism.

Even reliable pro-Trumper Geraldo Rivera chided the president for that tweet.

“Fear my friend @realDonaldTrump undermines himself by using intemperate, boorish language to describe his enemies. I can’t stand @OMAROSA a bully, back stabber & big mouth. But to call her a ‘dog’ & ‘low life’ is beneath dignity of the office of @POTUS & open to ugly connotation,” he tweeted.