Last January, New York police officer Robert Smith was about two months away from retiring.

But before he left the department, federal prosecutors said, he was set on recruiting another colleague to take over a year-longs bribery scheme he ran with the help of Officer Robert Hassett.

Smith and Hassett took thousands of dollars in cash from a tow truck company, according to court records, in exchange for sending victims of car accidents to the firm. Around the time he retired, Smith enlisted Officer Heather Busch, another of his colleagues from the Queens precinct, to take part of the illegal operation, the government said.

On Tuesday, authorities arrested and charged Smith, 44, Hassett, 36, and Busch, 34 with multiple counts of bribery and conspiracy in connection with the tow-truck scheme, according to an indictment filed in the U.S. District Court for the Eastern District of New York.

Smith, whom prosecutors said repeatedly used the n-word, expressed his support for the Ku Klux Klan and threatened to “shoot” his contact at the tow company if he ended up being a “rat,” is also accused of transporting heroin for an unnamed criminal organization after he retired.

“As alleged, the defendants shamelessly violated their oaths of office and the public trust by trading their badges for cash payments,” United States Attorney for the Eastern District of New York Mark J. Lesko said in a statement.

Lawyers representing Smith and Hassett did not immediately respond to messages from The Washington Post early Wednesday. Busch’s attorney declined to comment.

In New York City, officers responding to a crash scene are required to use a database system to assign tow trucks at accident scenes and are forbidden from handpicking companies.

Instead, starting in September 2016, Smith and Hassett allegedly told the drivers to use just one tow truck company, which isn’t identified in court records. In exchange, an individual with the business bribed the officers with thousands of dollars in cash directly paid to them or deposited in a mailbox they had access to, prosecutors said.

In January 2020, Smith and Hassett allegedly expanded their deal with the tow company. For the next three months, both officers used NYPD databases with names of recent drivers who’d suffered car accidents and sold their contact information to the tow company in exchange of more than $7,000 paid in cash, prosecutors said. Then, the tow truck company would sell that information to physical therapists and personal injury lawyers.

As Smith prepared to retire, he allegedly recruited Busch in March 2020 in exchange for more than $1,000 from the tow firm.

Around that time, Smith was also pressuring the tow company to help him set up a deal to transport drugs, prosecutors said. His contact eventually introduced him to an unnamed drug organization and in June 2020, Smith allegedly met with two of the organization’s drug traffickers about setting up a deal.

In July 2020, Smith drove from Uniondale, N.Y. to Queens to give someone a bag containing a kilogram of heroin while carrying his weapon, federal prosecutors said, in exchange for roughly $1,200 in cash.

On Tuesday, all three officers were arrested and charged in connection with the bribery scheme. The three appeared in court later that day.

Prosecutors argued that Smith, who pleaded not guilty, shouldn’t be released because he “poses a significant danger to the community and a flight risk.” Prosecutors also told U.S. Magistrate Judge Cheryl L. Pollack that there was additional evidence that Smith had participated in “shakes,” or robberies, as an NYPD officer.

At one time while still on the force, prosecutors said, Smith texted: “Bro I robbed everyone,” referencing individuals and businesses he tricked as part of the bribery scheme. In another message after he had retired, Smith allegedly texted a person and said he would brandish his gun in front of Black individuals just to see their reaction.

“Bro I point my gun out the window now at n------ and watch their reaction and drive away,” Smith wrote. “Hilarious.”

Other times, Smith, prosecutors said, called himself “the perp that got away” who would have been “locked up so many times” were he not a police officer. After he retired, Smith wrote he had shaved his head like the Ku Klux Klan.

“Now the real [S]mith will shine. I even shaved my head. Klan,” he wrote.

Hassett and Busch were released on bail after pleading not guilty, WNBC reported. Smith is being held without bail. Both Hassett and Busch have been suspended without pay, an NYPD spokesperson told The Post in an email.

“There is zero tolerance in the NYPD for corruption of any kind,” NYPD Commissioner Dermot F. Shea said in a statement.

The three are scheduled to appear in court on May 19, court records show.