Speaking at a Pentagon briefing, Mr Esper said he disagreed with the President's aspirations to deploy US military troops into the streets for the purposes of quelling the dissent movements triggered by the killing of Mr Floyd by former police officers in Minneapolis.
"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," Mr Esper said. "We are not in one of those situations now. I do not support invoking the Insurrection Act."
The Insurrection Act is an 1807 law allowing the president to use the US military to suppress civil unrest.
CNN - citing sources familiar with the inner workings of the White House speaking anonymously - reported that Mr Trump and his top officials are "not happy" with Mr Esper's dissent.
During the briefing, Mr Esper condemned the killing of Mr Floyd and called for the police officers involved to be punished.
"The officers on the scene that day should be held accountable for his murder. It is a tragedy that we have seen repeat itself too many times," Mr Esper said. "With great sympathy, I want to extend the deepest of condolences to the family and friends of George Floyd from me and the Department. Racism is real in America, and we must all do our very best to recognise it, to confront it, and to eradicate it."
In addition to taking a stance against Mr Trump's desire to use the military as a personal police force, Mr Esper also took the opportunity to distance himself from Mr Trump's decision to engage in a photo-op at St. John's Church after police forcibly removed protesters from the area.
Mr Esper came under fire recently for using the word "battlespace" to describe protest scenes. The defence secretary was asked about that terminology during the press briefing and said it was simply a force of habit, as it was "something we use day in and day out ... it's part of our military lexicon that I grew up with ... it's not a phrase focused on people."
He admitted that he would have used different wording if he could do it again.
At a press conference on Wednesday afternoon, Mr Trump's spokesperson Kayleigh McEnany said Mr Esper still enjoyed the president's confidence.
Using the military as a means for crushing dissent isn't an idea solely entertained by Mr Trump. US Senator Tom Cotton, a Republican representing Arkansas, was quick to invoke not only the idea of using the military against protesters, but even fantasized about which units he'd like to see deployed against the citizenry.
"Anarchy, rioting and looting needs to end tonight. If local law enforcement is overwhelmed and needs backup, let's see how tough these Antifa terrorists are when they're facing off with the 101st Airborne Division. We need to have zero tolerance for this destruction," Mr Cotton wrote.
Mr Cotton was an officer in the 101st Airborne Division.
He then went on to list all the groups he'd like to see fight "Antifa terrorists", including the 10th Mountain Division, 82nd Airborne, 1st Cavalry, 3rd Infantry and "whatever it takes to restore order," even going so far as to call for "no quarter" for "insurrectionists, anarchist, rioters and looters."
No quarter traditionally means that rather than capturing an enemy, they are killed.
Mr Cotton frequently attributes the protests to anarchist and Antifa, despite the FBI reporting that they have no evidence linking Antifa to any acts of violence at the George Floyd protests.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies