He was a high-ranking police officer with a big command who found himself answering questions in a major NYPD corruption scandal. Suddenly, he took his own life.

The date was July 16, 1950, and when Capt. John G. Flynn shot himself in a Brooklyn station house, the incident shocked the city and immediately raised questions about whether investigators were too aggressive with him.

Flynn’s suicide during the infamous Gross Scandal is echoed by the recent death of Insp. Michael Ameri, the highly regarded commander of the NYPD highway unit who officials say took his own life on May 13. Ameri, 44, of West Babylon, was found dead in his car by a golf course near his house from a single, apparently self-inflicted, gunshot wound.

It turned out Ameri had been questioned twice, once with his lawyer present, as part of a joint FBI-NYPD probe into possible criminal activity, Commissioner William Bratton said. But Bratton noted that Ameri, who had one of the city’s major commands, wasn’t a target of the investigation and had merely provided information. We may never know why Ameri took his life, Bratton said.

In Flynn’s case, the officer left a suicide note saying he didn’t kill himself because of the Gross probe into gambling corruption but rather because of problems at his station house, although his wife and others insisted investigators had hounded him.

Sometimes just the fact that a cop is questioned in an investigation may be unsettling enough to push the officer to suicide, said Dr. John M. Violanti, of the department of epidemiology and environmental health at the University at Buffalo.

“It is a dispiriting thing for officers to have to go through these things, regardless of whether they are innocent or guilty,” said Violanti, who has studied police suicides and other health issues.

In 2008, Lt. Michael Pigott, 46, of Sayville, took the heat for the way an emotionally disturbed naked man was hit with a stun gun and fell to his death. Pigott admitted responsibility for the mistakes but then killed himself, Violanti recalled. In the 1990s, amid a corruption scandal in the 30th Precinct — during Bratton’s first tenure as commissioner — two police suicides were attributed to the investigation.

During the infamous 1980s scandal in Brooklyn’s 77th Precinct involving drug sales by cops, Officer Brian F. O’Regan of Valley Stream shot himself to death in a Southampton motel room. Just days earlier, O’Regan had told a New York Newsday reporter about his involvement in corruption.

According to a study Violanti has done, about 15 percent of police suicides nationwide are related to investigations or legal problems. Relationship issues are believed to have accounted for 32 percent of the police suicides, with psychological problems at 12 percent and stress at 11 percent, according to his study. Other factors such as financial issues and alcohol abuse are believed to contribute to the remainder.

Prof. Eugene O’Donnell of John Jay College of Criminal Justice said the police culture is so immersive that it is hard for outsiders to understand the kinds of stress and shame cops feel when under scrutiny. Cops perceive three threats: loss of job, loss of reputation and loss of freedom if convicted, O’Donnell said.

“I think cops are more afraid of the [criminal justice] system because they are close to it,” O’Donnell said.

Violanti said records show that police have a 69 percent greater chance of committing suicide than the average American worker. A police officer is three times more likely to commit suicide than to be killed in the line of duty, he said.

The NYPD said on Friday that from 2011 through 2015, 27 police officers committed suicide, with an additional two cases so far in 2016. Reasons for the suicides were not given.

The NYPD has long acknowledged the problem of police suicides and has set up programs, including outreach and confidential help lines for cops who may be thinking about hurting themselves.

Roy Richter, head of the Captains Endowment Association, said Ameri’s death is serving as a wake-up call to other cops to not lose sight of the need to help one another.