A former C.I.A. officer who worked at the American Embassy in Mexico City pleaded guilty on Tuesday to drugging and sexually assaulting more than two dozen women over a period of 14 years, the Justice Department said.

Under an arrangement with prosecutors, the former officer, Brian Jeffrey Raymond of La Mesa, Calif., pleaded guilty in U.S. District Court in Washington to four of the 25 criminal charges that he had faced: one count each of sexual abuse, abusive sexual contact, coercion and enticement and transportation of obscene material.

In exchange for his plea, prosecutors agreed to drop the rest of the charges and recommend a sentence between 24 and 30 years with a lifetime supervised release. Sentencing is set for September 2024, prosecutors said.

Mr. Raymond’s crimes date as far back as 2006 and as recently as 2020 and took place in multiple countries where he had been working for the U.S. government, prosecutors said.

Brian Jeffrey RaymondCredit…F.B.I., via Associated Press

Mr. Raymond, 47, admitted to drugging and photographing or recording dozens of women while they were naked or partially naked at his government-provided housing in Mexico and in at least one other country, which was unnamed in court documents.

Three of the criminal counts that he had faced were for crimes that had occurred in the Washington, D.C., area, according to the indictment.

In total, Mr. Raymond abused 28 women over the 14-year period, prosecutors said.

“Many of the recordings show Raymond touching and manipulating the victim’s bodies while they were unconscious and incapable of consent,” the Justice Department said in a news release on Tuesday. “Raymond attempted to delete the explicit photographs and videos depicting the victims after learning about the criminal investigation.”

Mr. Raymond’s lawyer, Howard Bernard Katzoff, could not immediately be reached for comment on Tuesday evening.

In a statement on Tuesday, the C.I.A. said: “C.I.A. condemns in the strongest terms the crimes committed by former Agency officer Brian Jeffrey Raymond, who was arrested in 2020. As this case shows, we are committed to engaging with law enforcement to ensure that justice is served.”

The agency added that it had taken “significant steps” to combat sexual assault among its ranks, including the establishment of an office focused on “sexual assault and prevention.”

The U.S. Attorney’s Office for the District of Columbia declined to comment.

Mr. Raymond’s most recent assaults, according to prosecutors, happened in 2019 and 2020 in Mexico City, where he had been living while on assignment at the American Embassy.

He raped six different women in while in Mexico, with each assault following the same pattern, according to court documents.

Mr. Raymond met women through dating apps like Bumble and Tinder, spoke to them in Spanish and presented himself as a “high-level Embassy employee in whom the government had reposed special trust,” according to an agreed-upon statement of facts filed in court on Tuesday.

He drugged the women’s drinks and led them back to his embassy-leased apartment, where he would sexually assault and photograph them while they were unconscious, according to court records.

In some cases, the women regained conscious as Mr. Raymond was assaulting them.

The F.B.I. and the State Department began investigating Mr. Raymond in May 2020 after the Mexican police responded to a call at Mr. Raymond’s Mexico City apartment for a report of “a naked, hysterical woman desperately screaming for help” from the balcony, according to prosecutors.

The woman told the police that she had blacked out after drinking wine that Mr. Raymond had served her and did not remember having sex with him, though she had injuries indicating vaginal and anal penetration, prosecutors said.

Investigators said they discovered a trail of damning evidence on his electronic devices, including searches on his phones for “passed out gorl” and multiple videos of “passed out” women in his YouTube watch history.

On his laptop, investigators found searches for “passed out,” “ambien” and “Ambien and alcohol and pass out” along with similar queries, court records show.

The authorities also recovered about 400 photos and videos of his victims on his iCloud drive, along with dozens of messages he had exchanged with women, prosecutors said.

The federal authorities arrested Mr. Raymond in San Diego in October 2020 and initially charged him with photographing a woman he had met on Tinder in Virginia in 2017 while she was unconscious.

He was subsequently charged in connection with the additional victims in a superseding indictment in February 2023.