Former Navy Secretary Richard Spencer spoke out Wednesday for the first time since his weekend ousting by Defense Secretary Mark Esper, calling President Trump's intervention ahead of Navy SEAL Eddie Gallagher's review board "shocking and unprecedented" in a Washington Post op-ed.

Spencer wrote that Trump's action "was ... a reminder that the president has very little understanding of what it means to be in the military, to fight ethically or to be governed by a uniform set of rules and practices."

NAVY SCRAPS REVIEW FOR THREE SEAL OFFICERS IN EDDIE GALLAGHER CASE

Gallagher in July was found not guilty of murder and premeditated murder but was convicted of a lesser charge of posing for a photo with an Islamic State (ISIS) fighter's corpse during a deployment to Iraq in 2017.

The case drew international attention and caught the eye of Trump, who Spencer claimed intervened three times throughout the military justice process -- most recently when he called for Gallagher to keep his SEAL trident and be allowed to "retire peacefully."

Spencer detailed the process of trying to convene the review board, which he said would determine three things: what rank Gallagher would retire at, if he would leave the service with an "honorable" or "other than honorable" discharge, and if he would be allowed to keep his Trident pin, an iconic symbol that identifies a member of the elite SEAL force.

"Given my desire to resolve a festering issue, I tried to find a way that would prevent the president from further involvement while trying all avenues to get Gallagher’s file in front of a peer-review board," Spencer said. "Why? The Naval Special Warfare [NSW] community owns the Trident pin, not the secretary of the Navy, not the defense secretary, not even the president. If the review board concluded that Gallagher deserved to keep it, so be it."

In his efforts to avoid having the president intervene further, Spencer said he then began working "without personally consulting [Esper] on every step."

"That was, I see in retrospect, a mistake for which I am solely responsible," Spencer said.

Esper fired Spencer on Sunday and accused him of circumventing authority by engaging in direct negotiations with the White House to allow Gallagher to remain a SEAL. At the same time, Spencer was saying publicly that the Trident review board process should be allowed to play out.

NSW Commander Rear Adm. Collin Green had called for the Trident review board to decide whether Gallagher and three of his supervising officers were fit for duty. The board was set to convene as soon as next week before President Trump called for an end to investigations.

EDDIE GALLAGHER CONTROVERSY: ESPER FIRES NAVY SECRETARY, SEAL WILL KEEP TRIDENT PIN, PENTAGON SAYS

Spencer pointed out in his op-ed that Trump's directive came via a tweet, saying: "I recognized that the tweet revealed the president’s intent. But I did not believe it to be an official order, chiefly because every action taken by the president in the case so far had either been a verbal or written command."

The axed Navy secretary said he had received two calls in March from Trump "asking me to lift Gallagher's confinement in a Navy brig" while he was awaiting his court-martial trial.

"I pushed back twice, because the presiding judge, acting on information about the accused’s conduct, had decided that confinement was important," he explained. "Eventually, the president ordered me to have him transferred to the equivalent of an enlisted barracks."

"I came to believe that Trump’s interest in the case stemmed partly from the way the defendant’s lawyers and others had worked to keep it front and center in the media," Spencer added.

Trump would later intervene a second time following the jury's verdict, he explained.

"On Nov. 14, partly because the president had already contacted me twice, I sent him a note asking him not to get involved in these questions [posed by the review board]," Spencer said. "The next day, White House Counsel Pat Cipollone called me and said the president would remain involved. Shortly thereafter, I received a second call from Cipollone, who said the president would order me to restore Gallagher to the rank of chief."

Trump did restore Gallagher’s rank to chief petty officer and also granted clemency to two other U.S. military officers.

At the time, the review board was still slated to determine whether or not Gallagher would remain a SEAL, Spencer said.

"But the question was quickly made moot," he said; Trump tweeted on Nov. 21 that Gallagher would keep his Trident pin.

"The rest is history," Spencer said. "We must now move on and learn from what has transpired. The public should know that we have extensive screening procedures in place to assess the health and well-being of our forces. But we must keep fine-tuning those procedures to prevent a case such as this one from happening again."

CLICK HERE FOR THE FOX NEWS APP

He added, "More importantly, Americans need to know that 99.9 percent of our uniformed members always have, always are and always will make the right decision. Our allies need to know that we remain a force for good, and to please bear with us as we move through this moment in time."