OAKLAND — A local fentanyl dealer was sentenced to six years in federal prison after an undercover investigation that resulted in the raid of a pill laboratory set up in the Adams Point neighborhood near Lake Merritt, court records show.

Carlos Joel Castro-Arteaga, of Oakland, pleaded guilty to a federal fentanyl distribution charge and was sentenced on Jan. 28, by U.S. District Judge Haywood Gilliam, court records show. His arrest was the result of an undercover investigation last year, where Castro-Arteaga made several deals with a drug agent. This included a meet-up where the agent bought 168.4 grams of fentanyl in exchange for $1,500, prosecutors said in court filings.

The investigation led to a raid on Castro-Arteaga’s shared apartment on the 300 block of Euclid Avenue in Oakland. There, authorities found four pounds of fentanyl, $42,000, a hydraulic pill press, pill castings and drug manufacturing tools, a gun and 12 bullets, according to court records.

In a letter to the court, Castro-Arteaga said he had “true remorse” and didn’t realize how “truly destructive fentanyl is” when he was selling it. He said he learned that in jail, “through classes and books here, I have learned how this drug destroys people’s health, families, and futures.”

His attorney said in court filings he came to the United States from Honduras in search of financial opportunities.

“My arrest has deeply harmed my family. Before jail, I sent money home so they could eat, keep the lights and water on, and pay for my two siblings’ school needs — uniforms, books, and food,” Castro-Arteaga wrote. “Now they are struggling.”