Marine Maj. Michael Pretus, right, was investigated for having a threesome with a female midshipman and Marine Maj. Mark Thompson, left, who taught at the Naval Academy. Pretus later became an instructor there, too. He has since been removed. (Left: Nikki Kahn/TWP; Right: TWP)

The U.S. Naval Academy’s superintendent announced Monday that the school will correct a flaw in its vetting process that allowed a Marine Corps officer to teach there after he had been investigated for allegedly having sex with a female midshipman.

In June, The Washington Post revealed that Maj. Michael Pretus became an instructor not only because of a communication failure among military leaders, but also because of a systemic defect in the way the Naval Academy has screened dozens of its staffers.

The military did vet Pretus when he was selected in 2012 to get an advanced degree in history that would prepare him to teach. But the Iraq War veteran faced a crisis during the two years and eight months between when he received the news and when he was scheduled to start working in Annapolis.

A former female midshipman told authorities that while attending the academy in 2011, she had a threesome with him and another Marine, Maj. Mark Thompson, who taught history and was later convicted of sexual misconduct. Her accusation against Pretus triggered a criminal investigation that, according to military records, ended after he refused to cooperate.

Despite the inquiry, he became an instructor at Annapolis in August 2014. It wasn’t until The Washington Post wrote about Thompson’s case that academy leaders learned about the allegations against Pretus, who was removed from his position in April.

The school will now re-screen staffers after they’ve completed their advanced degrees and before they arrive on campus.

“It’s a very unique privilege to come teach at the U.S. Naval Academy. . . . We want to make sure we’re getting what’s been advertised,” Vice Adm. Walter E. Carter Jr. told The Post after announcing the change in protocol to the school’s Board of Visitors, an oversight group that includes nine members of Congress.

“I think they’re doing exactly the right thing,” said Rep. Rob Wittman (R-Va.), the board’s chairman.

He and Sen. Dan Sullivan (R-Alaska) said they had heard both from fellow lawmakers and academy graduates who are concerned about the revelations.

The lawmakers praised Carter’s decision to act and his transparency with them throughout the process.

As of June, 28 of the academy’s current faculty members, including 22 Marines, had arrived on campus the same way Pretus and many others have since the advanced-degree program began in 2006, the school said at the time. They were selected to get a master’s degree and then given two to three years to attend a university and move to Annapolis to work in the classroom. Although the military rigorously inspects their service records during the initial selection process, the academy acknowledged that they weren’t formally vetted again before being given positions of authority over midshipmen.

This meant that, as in Pretus’s case, the academy may have never learned about serious issues that could arise during the years while officers were earning their degrees.

The re-screening will reduce that risk.

The Air Force Academy does not have an advanced-degree program comparable to the Naval Academy’s, but West Point does. Thousands of Army officers have joined the school’s staff through it, although the Military Academy also doesn’t scrutinize service members a second time.

Carter told The Post that he had informed both academies of his decision and said he anticipates that they will make similar changes to their vetting processes.

In the past decade, at least 14 people who worked for or at the service academies were punished for sexual misconduct against students or for engaging in inappropriate relationships with them, according to military records and information provided by the three schools.

Pretus, however, is not counted among them, because his misconduct with a midshipman occurred before he arrived on campus.

What led to his removal from the staff began with an April 2011 trip to Annapolis, where he spoke to students in Thompson’s history class about his harrowing combat experience in Iraq.

Afterward, according to investigators, the longtime friends went to Thompson’s home and both had sex with a midshipman named Sarah Stadler. Back then, she and Thompson were in an illicit relationship prohibited by military law.

Pretus testified on his friend’s behalf after Stadler accused Thompson of sexual misconduct and a female classmate claimed that he had raped her.

At Thompson’s court-martial in 2013, Pretus provided key testimony that rebutted the women’s version of events. But during the trial, Stadler spotted Pretus and told military investigators that, although she couldn’t recall his name, she knew he was the Marine who’d joined in the tryst with her and Thompson.

The Naval Criminal Investigative Service interviewed Stadler and inspected Pretus’s service record, but the inquiry ended when he invoked his right to remain silent.

Academy officials probably wouldn’t have learned about the accusation had Thompson not fought so hard to clear his name. At trial, he was acquitted of the rape but convicted of five other charges related to sexual misconduct. Thompson later brought his story to The Post, which discovered that he had lied under oath to a Marine administrative board in 2014. In April, the Marines charged him with three additional crimes, and he is scheduled to face a new court-martial in January.

Pretus has agreed to testify against Thompson in the new case and has acknowledged to prosecutors that both men had sex with Stadler.