A transportation police officer accused of aiding a bias-fueled beating of a Muslim religious leader in a subway station has been cleared of all criminal charges.

Manhattan prosecutors dropped their case against Eddie Crespo this week after a grand jury declined to indict him on any charges in the Dec. 8 incident. Co-defendant Albert Melendez was indicted on a misdemeanor charge, but prosecutors said the specific charge wouldn’t be revealed until his next court date, as is their common practice.

Both were initially charged with assault and robbery as hate crimes in an episode that sounded alarms among Muslim advocates. The men’s lawyers, however, said religion played no role in what they described as a straightforward scuffle over an accidental nudge on a train.

“I think this was just a mistake, all along,” Crespo’s lawyer, Arnold Keith, said in an interview Wednesday as the Metropolitan Transportation Authority lifted his unpaid suspension from his job as a bridge-and-tunnel officer. The 28-year-old Crespo, who said he had broken up a fight rather than furthered it, spent about a day in jail after his arrest.

Melendez’ lawyer, who has called the allegations “trumped-up,” didn’t immediately return calls Wednesday and Thursday.

Manhattan district attorney’s office spokeswoman Erin Duggan said the agency “takes any allegation of a bias crime seriously.”

Prosecutors had said in a court document that Melendez, 30, declared “I don’t like Muslims” and used an insulting term for Muslims or Arabs while attacking a man who was wearing a traditional Muslim prayer cap and trying to get off a subway train in lower Manhattan.

The man, Imam Rod Peterson, has an arrest record of his own but now is a Muslim community leader in Queens, said his lawyer, Hassan Ahmad.

Crespo was accused of grabbing Peterson, 49, to help Melendez in the scuffle. According to prosecutors’ court papers, Melendez ultimately punched Peterson in the face and threw his prayer cap, called a kufi, onto the subway tracks. The imam ended up with a black eye, court papers said.

Defense lawyers said the fight began after Melendez and Peterson bumped into each other. Crespo told the grand jury he separated the two, asked Peterson whether he was all right, was rebuffed and walked away with Melendez, Keith said. Crespo never saw Peterson’s kufi, he said.

“He certainly did what he was supposed to do, as far as breaking up a fight between two men who got a little bent out of shape,” the attorney said.

Crespo and Melendez are friends, and Crespo dates Melendez’ sister; Melendez’ own longtime girlfriend is from a Muslim family, Keith said.

Peterson is extremely disappointed by the grand jury’s decision, Ahmad said Thursday.

While Peterson has had his own trouble with the law, “I don’t think that’s really what any of this should be about. He was attacked in the subway, based upon his appearance and religion,” the attorney said.

The Council on American-Islamic Relations — which issued a press release calling for hate crime charges as Crespo and Melendez awaited arraignment last week — said it had heard from Muslims “outraged by the attack and the result of the grand jury proceedings.”