A St. Louis County police sergeant alleges in a lawsuit against the department that he was told to "tone down" his gayness if he wanted a promotion.

Sgt. Keith Wildhaber St. Louis County Police

Sgt. Keith Wildhaber, a 22-year veteran of the department, also alleges he was passed over for promotions and reassigned after he filed a discrimination complaint in April 2016, The St. Louis Post-Dispatch reported.

Wildhaber said in the lawsuit that nearly all of his peers were promoted even though he ranked third in promotions tests and received "superior" ratings in all categories in performance reviews.

"(The department) believes plaintiff's behavior, mannerisms, and/or appearance do not fit the stereotypical norms of what a 'male' should be," according to the lawsuit.

The sergeant alleges that John Saracino, a member of the department's civilian police board in 2014, told him that his being gay was a problem.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"The command staff has a problem with your sexuality. If you ever want to see a white shirt (get a promotion), you should tone down your gayness," Saracino allegedly told Wildhaber.

On Wednesday, Saracino denied that allegation.

"I never had a conversation like that," Saracino said. "I would never say anything like that. That's not me."

Saracino later resigned from the board amid criticism for asking Police Chief Jon Belmar to write a letter of support to a federal judge who was sentencing Saracino's nephew in a marijuana ring.

A St. Louis County police car Lucas Jackson / Reuters

Wildhaber filed a discrimination complaint in April 2016 with the U.S. Equal Employment Opportunity Commission and Missouri Commission on Human Rights. He said a short time later he was reassigned from afternoon shifts to midnights in a precinct about 30 miles from his home.

A Justice Department report critical of the St. Louis County police response to protests of a police shooting in 2014 in Ferguson suggested that the department create a diversity council to advise commanders on issues regarding a variety of people — including ethnic, lesbian, gay, bisexual, transgender and linguistic minorities.

The department has not acted on the recommendation, said Sgt. Shawn McGuire, a spokesman for Belmar.

"Our main focus in recruiting is attempting to recruit outstanding candidates who want to become part of our organization, no matter what their status, race, religion, sexual preference, political belief, or aspiration is," McGuire said in a statement.

Belmar would not respond to the lawsuit, McGuire said.

The St. Louis County Police Association has asked Wildhaber to serve on a committee it is forming to "ensure all of our members are treated equally and fairly in the workplace, which is a bedrock principal of our organization," said Joe Patterson, its president and a county police detective.

Follow NBC Out on Twitter, Facebook and Instagram.