Washington (CNN) Recently ousted Navy Secretary Richard Spencer detailed President Donald Trump's intervention in a war crimes case in a Washington Post op-ed Wednesday, calling the President's actions "shocking and unprecedented."

"It was also 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," he wrote.

Spencer's op-ed comes just days after Secretary of Defense Mark Esper "fired" him for going outside his chain of command by proposing a "secret agreement with the White House," according to a senior defense official. Spencer appeared to be seeking a way to resolve a standoff between the Pentagon and the White House over Navy SEAL Eddie Gallagher's case.

Gallagher had been convicted of bringing discredit to the armed services after posing next to a dead ISIS fighter's body, which is against regulations. Earlier this month, Trump reversed Gallagher's demotion and later tweeted that he wouldn't let the Navy punish Gallagher in its ongoing review of whether he should be kicked out of the SEALs.

Behind the scenes, Spencer proposed to the White House that Gallagher's review go ahead but offered a secret guarantee that Gallagher would be allowed to keep his status as a Navy SEAL, according to the senior defense official.

Read More