The Navy has reassigned a former commander of the Blue Angels, its acrobatic fighter squadron, and is investigating allegations that the elite team of pilots was a hotbed of hazing, sexual harassment and other forms of discrimination, documents show.

The Navy announced Friday that it had relieved Capt. Gregory McWherter, a two-time commander of the Blue Angels, of duty for alleged misconduct. At the time, the Navy did not describe the nature of the accusations or provide other details except to say that the case remained under investigation.

But an internal military document that a Navy official inadvertently e-mailed to a Washington Post editor states that a former member of the Blue Angels filed a complaint last month accusing McWherter of promoting a hostile work environment and tolerating sexual harassment. The complaint described an atmosphere rife with sexually explicit speech, the open display of pornography and jokes about sexual orientation.

The Navy officer is the latest in a string of senior military commanders to come under investigation for sexual misconduct or other misbehavior. Congress and the White House have grown especially frustrated at the Pentagon’s struggles to police sex crimes and harassment in the ranks.

The Navy appeared to move swiftly after the former Blue Angels member filed the complaint March 24 with the Navy inspector general. The complaint alleged that McWherter encouraged or allowed sexual harassment and lewd activity to occur when he commanded the Blue Angels during two stints between 2008 and 2012.

McWherter did not respond to e-mails seeking comment. Late Wednesday, in response to a request for comment, the Navy confirmed the circumstances that led to the probe. The Navy also released a statement from Vice Adm. David H. Buss, the commander of Naval Air Forces, who said, “We remain fully committed to accountability, transparency, and protecting the integrity of ongoing investigations.”

According to McWherter’s bio-

graphy, which the Navy has removed from a public Web site, he is an alumnus of the Citadel and graduated from the Navy’s famous “Top Gun” fighter pilot school in 1995.

The Blue Angels are a flight demonstration team that performs daring maneuvers at air shows and before large crowds at other public events. It is a major honor for pilots selected to join; the Navy treats the squadron as a valuable recruitment tool and a vivid symbol of its aviation firepower.

The commander of the unit is chosen by a panel of admirals and serves as the Blue Angels’ lead pilot.

Although the investigation has not been completed, Navy officials decided that the preliminary findings warranted taking action. McWherter was fired from his new job as executive officer of Naval Base Coronado near San Diego. He has been temporarily reassigned to other duties.

Summaries of the complaint and investigation are contained in a five-page internal document, labeled “official use only,” that was drafted by Navy public affairs officers in anticipation of media coverage.

The document included talking points and prepared quotes attributed to Navy admirals, expressing concern about the gravity of the case. The material was being assembled in the event that further details of the investigation became public.

McWherter was a commander highly regarded by many in the Navy. He was brought back to lead the Blue Angels for a second stint in 2011 after the unit was temporarily grounded that year for performing a dangerous barrel roll too close to the ground during a show in Lynchburg, Va.

Upon leaving the team in November 2012, he told the Pensacola (Fla.) News Journal that he had no regrets.

“If being with the Blue Angels was the last time I fly a Navy plane, that’s a pretty good way to go out,” he said.

In the face of several ethics scandals over the past 18 months, the Pentagon has repeatedly pledged to hold commanders accountable for their actions. At the same time, however, the military has tried to suppress details about many embarrassing episodes.

For example, the Army announced in June, without elaboration, that it had suspended its top general in Japan for allegedly mishandling a sexual assault case. On Tuesday, after obtaining a copy of the investigative report under the Freedom of Information Act, The Post disclosed that the general was given a plum job at the Pentagon even though he had violated regulations by failing to refer the sexual assault complaint to criminal investigators.

In January, after obtaining another batch of investigative documents, The Post reported that the Pentagon had disciplined three other generals for personal misconduct.

One was found guilty of assaulting his mistress. A second joked in e-mails that he sexually gratified himself after meeting a member of Congress whom he described as “smoking hot.” The third kept a bottle of vodka in his desk and was investigated for having an affair, according to the documents.

At the same time, it appears that some military leaders have become highly sensitive to the issue and are quick to launch investigations at any hint of sexual impropriety or ethical misbehavior in the ranks.

In February, the Army announced it had suspended a brigade commander at Fort Carson, Colo., and in a highly unusual move, would not allow him to deploy with his soldiers to Afghanistan. Again, Army officials did not divulge what had prompted the decision.

A copy of the investigative report in that case, however, shows that the commander was suspended after three female soldiers alleged that he had made insensitive comments during a meeting to discuss sexual assault policies.

The commander, Col. Brian Pearl, was later cleared of wrongdoing and allowed to join his troops in Afghanistan. A copy of the investigative report was first obtained and published Tuesday by the Gazette newspaper of Colorado Springs.