Harry Hu, a legendary Oakland police gang expert and Asian organized crime investigator, has pleaded guilty to taking bribes from his longtime confidential informant in exchange for helping him avoid prosecution, federal court documents show.

Hu admitted that while he worked as an Alameda County District Attorney Inspector he received free trips to Reno and Las Vegas, which included alcohol and paid escorts. Hu also admitted that he knew about the informant’s connection to a 2013 double murder in Mendocino County and that he lied to the FBI about his relationship with the informant, Wing Wo Ma.

The plea deal unsealed Thursday tarnishes a 37-year career spent infiltrating Chinese-American gangs and taking down some of their biggest leaders, first as a member of the Oakland Police Department and then as an Alameda County District Attorney inspector until last month. In Oakland’s Chinatown, there was perhaps no cop better known than Hu.

Hu, 62, was convicted of conspiracy to commit fraud against the government and bribery, and faces a maximum prison sentence of five years. He appeared Wednesday afternoon before U.S. District Judge Charles Breyer in San Francisco federal court in a hearing closed to the public. When approached by a Bay Area News Group reporter in the hallway outside the courtroom, Hu identified himself but refused to answer questions.

“I can’t talk to you about my case,” Hu, dressed in a suit and tie, said before the hearing. His attorney later arrived, and she and Hu went over a handful of court documents, before entering Judge Breyer’s courtroom. Five minutes later, the pair emerged and the attorney declined comment.

Alameda County District Attorney Nancy O’Malley said Hu has violated the trust of the people and of those who protect and serve the public.

“Former Inspector Harry Hu has brought shame on himself, on the Alameda County District Attorney’s Office and the Oakland Police Department, as well as on the justice system,” O’Malley said in a statement to this news organization. “When a public official, especially one entrusted with upholding the law as Harry Hu was, breaks that trust, it strikes a hard blow against the hard working and ethical professionals of the District Attorney’s Office.”

Oakland Police spokeswoman Johnna Watson issued a statement late Thursday saying the department is “appalled by the actions of former employee Harry Hu, who intentionally chose to serve his greed and desire by associating with criminals and engaging in criminal activity.”

“Harry Hu’s actions violated public trust, tarnished the honorable badge and failed to uphold the high standards and values of law enforcement,” the statement said.

Born in Hong Kong, Hu joined the Oakland police force in 1981, and broke down barriers in the city’s Chinatown. He served as a liaison officer to the area’s substation and headed the police gang unit. The FBI deputized Hu to work organized crime cases. In a 2010 radio interview with KALW, Hu said in the 1990s he targeted the Oakland Chinatown gang the Wo Hop To, a case that caught the attention of federal agents.

Among OPD Asian officers, Hu was known as “dai lo,” or big brother. Multiple law enforcement sources said one of Hu’s trusted underlings, a former Oakland police officer who currently works as a Alameda County welfare fraud investigator, cooperated with federal investigators in their case against Hu.

In 2008, Hu gave Ma $40,000 as an investment to a Las Vegas construction project, according to court records. During that time he made a deal with Ma. “I agreed to provide future assistance to him in avoiding prosecution, by taking official action or by refraining from taking official action,” Hu wrote in his plea deal declaration. Between 2008 to 2013, Ma would use Hu’s name as an investor in order to appear legitimate; Hu was usually present when this happened, according to his sworn statement.

Hu is alleged to have meddled with Oakland police investigations. In December 2009, two years after he retired from the police force to work for the DA’s office, Hu called an Oakland officer and said that Ma was a witness for a marijuana grow investigation when he was in fact, a suspect, records show.

Ma, also known as Mark Ma, was an early suspect in a 2013 double murder of suspected Chinese underworld gangster Jim Tat Kong and his girlfriend, Cindy Bao Feng Chen, shot dead in a minivan in Mendocino County. Ma has since been indicted for the Mendocino County murders.

Court records show Hu had his suspicions about the Mendocino County slayings, and knew Ma was there at the time. At a meeting with Hu at an Oakland hotel, Ma said the FBI interviewed him. Based on his demeanor, Hu suspected him of being somehow involved but did not contact investigators, he wrote in his plea agreement. A 2015 FBI affidavit said Ma “attempted to continue to use his position as a law enforcement informant with multiple handlers, to obfuscate his involvement and manipulate the investigation of the homicides.”

In federal court documents filed in April 2017 and re-filed last week on Oct. 4, authorities indicted Ma in the killings outside Fort Bragg. His official charge is furtherance of a drug trafficking crime and use of firearm during and in relation to drug trafficking crime and use of firearm resulting in death.

Ma has been in custody ever since he was convicted of conspiracy to distribute marijuana as part of the FBI’s investigation into the case against Raymond “Shrimp Boy” Chow, which also took down former state Sen. Leland Yee. Chow is serving a life sentence for racketeering and arranging murders. On Thursday, the U.S. Attorney’s Office said a federal grand jury added bribery to the list of charges pending against Ma.

His criminal record includes a 2002 felony pimping arrest in San Rafael but he was convicted of running a house of prostitution, a misdemeanor, according to the 2015 FBI affidavit. He served 45 days in jail. Other records show Ma was often given probation or short jail sentences. After Ma’s 2002 arrest, Hu wrote a letter to an immigration judge to stop the court from deporting him.

Hu resigned as an Alameda County District Attorney Inspector the week of Sept. 10, sources said. He had worked for the DA’s Office since 2007, shortly after retiring as a lieutenant from Oakland police. Most recently, the inspector was out on medical leave as a result of an on-the-job car accident. The 2013 Mendocino murders occurred while Hu worked at the DA’s office.

By pleading guilty to a felony, Hu forfeits the portion of his retirement pay after the date of the crime, under state pension law that took effect in 2013. He will keep his estimated $150,693 Oakland police retirement pension.

DA spokeswoman Teresa Drenick said in an email that the DA’s office is reviewing cases involving Hu.