A John Jay College professor who got a $2.6 million federal grant to study the city’s heroin epidemic was charged yesterday with embezzling funds to finance his own drug use.

According to a federal criminal complaint filed yesterday, Ansley Hamid, 55, an anthropology professor at the Midtown criminal-justice college, also used the federal grant money to fund trips and buy CDs.

“One day the story will get out,” Hamid told reporters as he left his arraignment at Manhattan federal court after being released on $25,000 bond. “The whole story.”

The complaint said that Hamid wrote in project field notes in October 1996: “Yesterday ended my monthlong experiment [with] … heroin.”

Hamid, when confronted by investigators, admitted that he took heroin while serving as project head, the complaint charged.

A person working on the project in Brooklyn said that Hamid instructed him to use $100 of the grant money to compensate junky study subjects with 10 bags of heroin, the complaint said.

It also said Hamid inappropriately used grant money to travel to Hawaii, where he served as a witness in a narcotics trial, and for a flight to his native Trinidad, although he was paid $10,000 for the same trip by the United Nations Development Program.

The complaint also charged that Hamid squandered study money on $2,000 worth of compact discs of singers such as Mariah Carey, the Spice Girls and Abba.

If convicted, Hamid could face a maximum of 10 years in prison and a fine of $250,000.

He and another anthropology professor were awarded the grant from the National Institute on Drug Abuse in 1996 to examine heroin use and distribution in the city.

The two were supposed to track heroin use here through the year 2000, when they predicted a heroin epidemic would bloom as the drug spread to affluent, nonminority groups.

John Jay official Mary Rothlein said Hamid was suspended from work Jan. 8 and is “currently involved in a disciplinary procedure at the college.”