He really was a mad scientist. Dr. Mohsen Hosseinkhani, angry over losing his fellowship at Mount Sinai Medical Center, allegedly swiped secret scientific material and screwed over his fellow researchers — by shuffling around their lab rats, sources told The Post yesterday.

Hosseinkhani, 40, “moved all the animals around from cage to cage so they didn’t know which was which,” a law-enforcement source said.

Hosseinkhani was arrested Tuesday and charged with burglary and grand larceny for two alleged break-ins at Mount Sinai.

Sources said he was bitter that the hospital had dumped him from its cardiology-fellowship program in June because his research in molecular mechanism of cardiac regeneration wasn’t up to snuff.

“His work was lacking compared to the others in his group,” one source said.

The hospital also found that information he provided about his background was “not credible,” the source added.

Hosseinkhani got his revenge on July 1, when he allegedly slipped into the lab and shuffled a control rat with other test subjects.

It’s unclear what research was being conducted.

He then ran off with stem-cell cultures, antibodies and other scientific materials in the 9 p.m. raid, according to a Manhattan Criminal Court complaint.

A source said he stole more than $10,000 in materials, at one point flying to Russia with some of the stuff, which included a cancerous chemical.

Monday morning, Hosseinkhani returned to the crime scene to steal some pipettes — lab tools used to transport liquids, court papers state.

“[Hosseinkhani] did not have permission or authority to enter into the areas of the above location on either July 1, 2011, or Nov. 28, 2011,” the complaint states.

The hospital released a statement saying, “Mr. Mohsen Hosseinkhani was a post-doctoral fellow engaged in research until June 2011, and had no contact with patients. Mount Sinai will continue to cooperate with the investigation.”

Hosseinkhani claims on his LinkedIn profile that he earned his Ph.D. in cardiac regeneration from Harvard Medical School and received his medical degree from Shahid Beheshti Medical University in Iran.

The clumsily spelled online listing identifies Hosseinkhani as a “Medical Docotor at Mount Sinai Hospital Foundation.”

A Harvard spokesman was unable to confirm if Hosseinkhani had ever been a student there.

On another Web site, Hosseinkhani claims to have secured his Ph.D. from Kyoto University in Japan.

Hosseinkhani, whose name does not turn up in a registry of New York medical doctors, was freed Wednesday after posting $15,000 bail. He’s scheduled to appear before a judge early next week.

Records list him as last having lived at an East 97th Street address near the hospital, but neighbors said they had no recollection of him.

Additional reporting by José Martinez