A complaint filed Tuesday afternoon with the Defense Department’s Inspector General blasts Rear Adm. Collin Green as a scheming martinet willing to trash the reputations of bonafide SEAL combat heroes to preserve his precarious perch atop Naval Special Warfare.

The 17 pages of detailed allegations by ex-SEAL Team 7 leader Cmdr. Edward J. Mason and Master Chief Special Warfare Operator Hugh C. Spangler come in the wake of their Sept. 6 firing by Green, whose command cited “a loss of confidence that resulted from leadership failures that caused a breakdown of good order and discipline within two subordinate units while deployed to combat zones" for their removals.

Also canned was Lt. Cmdr. Luke Hong Il Im, the team’s executive officer, but he did not put his name to Tuesday’s filing.

Stamped 2019-0924164500084, the complaint urges Pentagon investigators to polygraph Green and his top enlisted adviser — Force Master Chief Master Chief Petty Officer (SEAL) William A. King — to prove they tolerated a boozy culture overseas, where liquor is banned for other military personnel.

King also stands accused of stating “that any enlisted SEAL who 'played lawyer games’ by asserting rights provided under Navy Regulations would summarily lose their SEAL tridents," according to the complaint.

Navy spokesman Rear Adm. Charles Brown told Navy Times that it would not be “appropriate to discuss a complaint submitted for consideration and potential review by the Inspector General" before adding that “we take allegations of misconduct seriously and the IG investigates all credible allegations.”

Naval Special Warfare officials referred all comments to Brown, the chief of naval information.

The detailed complaint arrived at the IG two days before the new chief of naval operations, Adm. Michael Gilday, is slated to visit Green’s Naval Special Warfare HQ in Coronado, California.

The filing asks Gilday to “order a Command Climate Survey regarding the leadership ability of RADM Green and CMC King which will inevitably provide the additional compelling evidence” to detach them from Naval Special Warfare for cause.

Prepared by San Diego attorney Jeremiah J. Sullivan III, the complaint depicts the highly decorated Mason and Spangler as war heroes “unjustly fired” as “expendable scapegoats” and “victims of flagrant abuses of power and deliberate retaliation” by Green.

They ask to be “immediately reinstated” at SEAL Team 7, which apparently remains without a command triad.

Central to the IG complaint is the accusation that Green’s “duplicitous actions were done in an attempt to bolster his own reputation and protect his own career” while a string of public scandals involving SEALs played out.

They included SEAL Team 7′s Foxtrot Platoon — which got booted from Iraq back to Naval Base Coronado following a July 4th party that included alcohol, with ongoing investigations for sexual assault, fraternization and other allegations of misconduct trailing in their wake — but included what Green allegedly termed the “Gallagher Effect,” according to the complaint.

On July 2, a military panel of his peers at then-Special Warfare Operator Chief Edward “Eddie” Gallagher’s court-martial trial in San Diego cleared him on premeditated murder, obstruction of justice and all but one other charge tied to a 2017 deployment with Alpha Platoon, SEAL Team 7, to Iraq.

Gallagher, 40, was found guilty only of appearing in a photograph that depicted him near a dead Islamic State prisoner of war, an allegation he never denied.

Gallagher’s name peppers the complaint 17 times, alluding to concerns Green allegedly harbored about the special operator, a SEAL who also captured the attention of President Donald J. Trump.

The complaint contends that Green “has openly challenged the clear direction provided by the President, undermined the verdict rendered by an impartial jury, and retaliated against the leadership of (SEAL Team 7).”

Although Gallagher was long gone from the team when Mason took command in late 2017, the complaint reveals a meeting where Green allegedly accused the commander of failing to adequately address a lingering “Gallagher Effect,” a phenomenon which is never defined in the filing.

But their apparent failure to properly address the so-called Gallagher Effect partly led to their firings, actions by Green that “publicly undermines the President in front of the (Naval Special Warfare) community," the complaint alleges.

On March 30, Trump took to Twitter to announce that he ordered the Pentagon to release Gallagher from pretrial confinement in San Diego’s Naval Consolidated Brig Miramar.

A day after the verdict in Gallagher’s court-martial case, Trump also tweeted congratulations to the SEAL, his wife Andrea, and his entire family, and he later nixed the Navy Achievement Medals for junior prosecutors and legal clerks who worked on a case riddled with allegations of attorney and Naval Criminal Investigative Service misconduct.

In the aftermath of the Gallagher verdict, Green met with then-Chief of Naval Operations Adm. John Richardson in Washington, according to the complaint.

The SEALs allege that Richardson confronted Green about the state of Naval Special Warfare but allowed him to return to Coronado to carry out what became a “back to basics” initiative designed to anchor the teams to Navy standards for discipline, grooming and accountability.

In California, Green “unleashed a toxic plan” through “his own series of meetings where he yelled at subordinates as he scrambled to save his career,” according to the complaint.

Whipping him along was Richardson, who allegedly made multiple angry calls to Green to fix Naval Special Warfare, “putting immense pressure on him,” the filing states.

During at least one of Green’s sessions with subordinates, he allegedly “admitted that one of the unlawful driving factors in deciding to fire CDR Mason and CMC Spangler was that they had each already decided to retire with honor and dignity," according to the filing.

But “Green’s transparent conduct backfired and undermined his own integrity” and officers and their SEALs “know what happened and they know who is to blame” and they’ve “lost confidence” in Green partly because he engages in “leadership by tirade,” Sullivan wrote.

The complaint paints a different picture of high ranking brass in Iraq who allegedly backed Mason and Spangler while Green moved to relieve them, including Combined Joint Task Force Operation Inherent Resolve Lt. Gen. Paul Joseph LaCamera.

On July 31, LaCamera told SEAL Team 7′s leaders that he had their “complete trust and confidence," despite the Foxtrot Platoon problems, and that comment became an electronic Situation Report — sitrep — that made its way to Naval Special Warfare, according to the filing.

But that allegedly drew a rebuke from Green, who told the three-star that the remark failed to “fit his narrative," the complaint states.

During a two-day mid-August visit to Mason’s command in western Iraq, Maj. Gen. Eric T. Hill, the commander of Special Operations Joint Task Force – Operation Inherent Resolve, allegedly echoed LaCamera by saying he remained “confident in their ability to lead the command."

Support also allegedly came from an unnamed investigator in Iraq who had probed allegations of misconduct there. A portion of an email is included in the complaint which indicates he was “absolutely appalled and disgusted that they did this to [CDR Mason] and CMC Spangler.”

“You did everything right,” it continues. "I guarantee you did far more than the other 99 percent of commanders SOF wide to ensure the correct ethical climate was established, and I stand 100 percent behind my recommendation that you and the CMC should not be held liable for the actions of a few sailors who willfully and maliciously acted in direct conflict with your orders.”

On the day Mason was relieved, he allegedly brought up “the outstanding support he received from his chain of command in Iraq following his relief from command,” but Green brushed off their assessments by saying “they are only tactical," according to the complaint.

The complaint states that Mason asked Green why he didn’t take a call from Iraq that would “provide context and details regarding the situation,” the Naval Special Warfare commander answered that he was “in charge of 10,000 people and can’t dive into every situation."

The complaint accuses Green of failing to understand key aspects of SEAL deployments, including how a Special Reconnaissance Team trains before an upcoming tour.

That’s important because Green took Mason and Spangler to task for problems apparently uncovered with Coronado-based Special Reconnaissance Team 1, according to the filing.

The complaint reveals concerns that Special Reconnaissance Team 1 had not worn military uniforms in two years and Mason also directed them to shave their beards because “there was no compelling reason for them to have facial hair.”

Some Special Reconnaissance Team 1 members also allegedly conducted operations off base without Mason’s approval, sparking “shocking” results from an internal probe and a crackdown by the SEAL Team 7 leader, according to the complaint.

Navy officials declined comment.