Editor's Note: This article originally appeared on Business Insider.

President Donald Trump was so infuriated by Defense Secretary Mark Esper's public disapproval of his suggestion to send in U.S. troops to subdue protests that he was on the brink of firing Esper, The Wall Street Journal reported.

Trump has said he wants to “deploy the United States military” in response to protests and unrest in the nation's capital and elsewhere in the wake of the Memorial Day death of George Floyd, a 46-year-old Black man who died after a white Minneapolis police officer knelt on his neck for nearly nine minutes while Floyd pleaded that he could not breathe.

Trump said last week that if a city or state fails to act, “then I will deploy the United States military and quickly solve the problem for them,” suggesting that he might invoke the Insurrection Act.

Esper broke with the president on Wednesday, catching the White House off guard at a Pentagon press briefing where he expressed opposition to the Insurrection Act and sending active-duty troops into American cities to combat unrest.

“I have always believed and continue to believe that the National Guard is best suited for performing domestic support to civil authorities in these situations in support of local law enforcement,” Esper said at the Pentagon on Wednesday.

“The option to use active-duty forces in a law enforcement role should only be used as a matter of last resort and only in the most urgent and dire of situations,” he said. “We are not in one of those situations now. I do not support invoking the Insurrection Act.”

He also walked back his characterization of U.S. cities as a “battle space” to be dominated, language the president used as well last week, and distanced himself from Trump's photo op at a church and the forceful removal of protesters from a Washington, DC, park that made that possible.

His remarks were not well received at the White House, where top officials were “not happy” with the secretary, CNN reported at the time, citing multiple people familiar with the matter.

The White House has been frustrated with Esper's tendency to go off message and his lack of enthusiasm for the president's policies, CNN said. Trump was outraged by Esper's remarks Wednesday and sharply criticized him at the White House, an administration official told The New York Times last week.

Asked on Wednesday afternoon if the president had lost confidence in Esper, White House press secretary Kayleigh McEnany said, “As of right now, Secretary Esper is still Secretary Esper.”

A few days later, she followed up with a more ringing endorsement, saying, “President Trump remains confident in Secretary Esper. Secretary Esper has been instrumental in securing our nation's streets and ensuring Americans have peace and confidence in the security of their places of business, places of worship, and their homes.”

According to The Wall Street Journal, Trump consulted several advisers to ask their opinion of the disagreement with Esper and was intent on dismissing him. Esper is Trump's fourth defense secretary since the president took office in 2017.

Esper, meanwhile, was also aware of Trump's anger with him and began preparing to resign, in part because of their disagreement over the role of the US military, The Journal said

More from Business Insider: