(CNN) The former Navy secretary forced out of the Trump administration last year is endorsing Michael Bloomberg for president, saying the former New York City mayor will "respect the advice of military advisers."

"I am proud to endorse Mike Bloomberg for President of the United States. I have the utmost confidence that Mike will faithfully execute his duty as Commander-in-Chief," Richard Spencer said in a statement Friday.

Spencer was fired in November by Defense Secretary Mark Esper for going outside his chain of command by proposing a "secret agreement with the White House" regarding the case of Navy SEAL Eddie Gallagher , who was accused of war crimes.

After being ousted, Spencer wrote an op-ed criticizing the President's intervention in Gallagher's war crimes case as "shocking and unprecedented," adding that Trump has "very little understanding of what it means to be in the military."

In his endorsement of Bloomberg on Friday, Spencer argued that the Democratic candidate would "preserve, protect, and defend the Constitution and uphold the Uniform Code of Military Justice."

"Restoring America's standing in the world and repairing relationships with our allies will be a top priority in Mike's administration," he added in a veiled swipe at Trump for his foreign policy stance of "America First."

Spencer plans to campaign with Bloomberg at an event Friday in Norfolk, Virginia, where the former mayor will roll out his policy plan to address economic and health concerns of military families.

Gallagher was convicted last year of bringing discredit to the armed services after posing next to a dead ISIS fighter's body in 2017. He was acquitted of the other charges, including premeditated murder of the ISIS fighter.

Trump reversed Gallagher's demotion despite warnings from military leaders that the move could undermine the forces' order and discipline and damage the integrity of the military justice system.

The President also tweeted that he wouldn't let the Navy punish Gallagher in its ongoing review of whether he should be kicked out of the SEALs, but Spencer had indicated publicly that he felt the review should proceed.

He 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.