Two New York City correction officers and a former officer who resigned this year have been arrested on charges that they smuggled prescription pills and other contraband into Rikers Island, the authorities said on Tuesday.

The arrests came after a five-month sting operation by several city and federal agencies that involved undercover officers, wiretaps, fake drugs and hundreds of dollars in so-called courier fees paid to the officers for ferrying narcotics into one of the nation’s largest jails.

“By smuggling drugs into a correctional institution, they undermined the security of everyone at Rikers Island — inmates, officers and staff,” said Bridget G. Brennan, New York City’s special narcotics prosecutor, who helped lead the investigation.

Between Feb. 25 and June 23, the three officers each met with people they believed to be friends and relatives of inmates at Rikers, but who were actually undercover investigators from the Department of Investigation, officials said. The investigators arranged for the officers to bring what they believed to be oxycodone pills — they were fake — into the jail in exchange for payments from $500 to $900, the authorities said.