MARTINEZ — A Contra Costa sheriff’s deputy has sued his employer and numerous officers alleging he was denied promotions because he served as a Marine and faced discrimination over his sexual orientation and race.

The civil complaint was filed in U.S. District Court of Northern California on Dec. 21 on behalf of Deputy Miguel Aguilera. Among the many allegations in the 62-page civil complaint, some of the most shocking involve public postings in sheriff’s offices that discriminated against multiple races and sexual orientations.

“I’ve been in the department for 12 years and I’ve given them plenty of opportunities to rectify themselves,” Aguilera said. “I’ve informally brought these illegal things to their attention before filling a complaint, but time and time again they don’t do anything. I don’t want money, I just want to be in a good department.”

Aguilera’s allegations, which cover a 10-year period, include descriptions of abuse at the County Jail, homophobic innuendo and a sergeant’s remark that after President Donald Trump builds a wall along California’s southern border, Bay Point’s Latinos “will all go back to Mexico.”

Start your day with the news you need from the Bay Area and beyond.

Sign up for our new Morning Report weekday newsletter.

Contra Costa Sheriff’s Office spokesman Jimmy Lee referred all requests for comment to the county’s attorneys, who declined to comment. County officials say they must file a response to the suit within 21 days after being served, which hasn’t happened yet.

Aguilera was deployed to Iraq in October of 2006, shortly after graduating the academy. He said he did not experience harassment before he left the country, but as he was returning from his tour of duty, he said he received a call from a deputy who said officers were planning to cause trouble for him. This was when Aguilera said he started a logbook of instances of persecution and discrimination.

“This is a man who served his country and when he came home, he also wanted to serve his community, but he ran into so many roadblocks doing it,” said Zane Hilton, an attorney with the Sacramento-based Bohm Law Group, which is representing Aguilera.

After becoming a deputy, Aguilera was first assigned to the Martinez Detention Facility and claimed in the lawsuit that the harassment was so widespread that even the inmates of the County Jail knew he was being targeted. Hilton said there was even one alleged investigation into “whether or not he smelled,” which was ultimately unsubstantiated.

On Jan. 23, 2009, Aguilera alleged, he saw pictures of recruits with racial and sexual slurs written underneath them in a Training Officer’s Room in Pittsburg. Indian recruits were labeled “Taliban,” Mexican recruits were labeled “Norte,” which refers to the Nortenos gang, and black recruits were identified as “Green Mile.”

Reached on Friday, Aguilera pointed to his exemplary military career to bolster his allegations.

“I’m extremely good at my job in the Marine Corps, and the sheriff’s department is not a stressful job compared to that,” Aguilera said.

In the lawsuit, Aguilera alleged that deputies spread rumors about his sexuality and made transphobic comments, such as referring to Caitlyn Jenner as “it” and her transition as “disgusting.” He described a Dallas Cowboys merchandise flier posted in April 2015 in the sheriff’s Delta Station in Oakley as having a caption that read: “Signs That Your Kid Might Be Gay.”

Aguilera alleges that he asked a sergeant why he was assigned full time to the heavily Latino community of Bay Point, when other deputies were assigned to different areas. The sergeant, according to Aguilera, said he would transfer him “(after) Donald Trump gets elected (because) he is going to build the wall, they will all go back to Mexico.”

Court documents state that Aguilera reached a settlement with the Sheriff’s Office in 2009 after he was denied a pay increase because of his military leave. Aguilera said he filed complaints over multiple USERRA violations, which govern veterans employment rights, including not accruing holiday pay while on military leave, not being allowed to take promotional exams and being denied positions. According to the lawsuit, Aguilera said a supervisor told him that was because “he was always gone on military leave and it was unfair for (a division) to be short-staffed due to (Aguilera’s) absence.”

The lawsuit also details allegations of sexual harassment against Aguilera by another Sheriff’s Office employee.

In a rare move, a judge approved a restraining order against Lt. Sean Yates in December 2015. Aguilera had reported at the time that he was told to watch his back and that Yates would “kick (Aguilera’s) ass.” The restraining order was dismissed three weeks later.

At the time, Yates’ attorney, Dan O’Malley, described his client as a “decorated lieutenant” with the Sheriff’s Office and said there hadn’t been any interaction between Aguilera and Yates in several years.

“It is sad that Mr. Aguilera would use and abuse a system by misleading the court … there is no relationship between the two of them, and yet Aguilera wants to ruin the career of Lt. Yates,” O’Malley wrote in a brief filed the day before a judge dissolved the restraining order.

Aguilera himself was named as a defendant in a high-profile lawsuit last year, filed by the parents of 9-year-old murder victim Jordy Almgren. The suit, which has since been dismissed, alleged that during a domestic disturbance call at the home of Almgren’s killer, William Shultz, Aguilera failed to secure a knife that would later be used to murder Jordy. County officials, though, say Aguilera acted properly.