Det. Joseph Crystal witnessed a handcuffed drug suspect beaten and his ankle broken by a fellow Baltimore police officer. When he was compelled to report it to his superiors, the nightmare started. Crystal, now a police officer in Florida, is suing the department over the backlash.

Before he became public enemy No. 1 inside the Baltimore Police Department, Det. Joseph Crystal was considered one of its rising stars.

The son of two NYPD cops, Crystal was put in charge of his police academy cadet class on day one.

He was promoted to detective before he reached his second year on the force.

And he went on to lead his violent crime unit in gun arrests, racking up high-profile collars that made the evening news.

For Crystal, rooting out crime in one of the most violent cities in the nation didn’t even feel like work.

“Being a cop was all I ever wanted to do,” he says. “A dream come true.”

But that dream turned into a nightmare four years ago when his brothers in blue turned on him – bombarding him with taunts and threats, refusing to come to his aid during drug busts and even leaving a dead rat on his windshield.

His crime? He reported a case of police brutality.

Crystal drew the ire of his department after coming forward to report the 2011 beating of a drug suspect by a fellow officer. Crystal’s subsequent trial testimony helped secure convictions against the cop who carried out the beating and the sergeant who helped facilitate it.

Crystal says the pattern of abuse that followed led him to resign from the job he loved.

“I never imagined that doing the right thing as a cop could cost me so much,” Crystal, 31, told the Daily News this week in his most extensive interview to date.

Crystal filed a federal lawsuit against the Baltimore Police Department three weeks ago, claiming it failed to protect him from retaliation after he blew the whistle on his fellow officers.

A department spokesman declined to address any aspect of Crystal’s case. “We don’t comment on pending litigation,” said Det. Ruganzu Howard.

Crystal felt like he was on top of the world when he started working for the department in 2008.

The New Jersey native had spent the last six years working for the Coast Guard. He graduated boot camp three days before the 9/11 attacks and then spent more than a week guarding the smoldering site.

The Coast Guard job fulfilled his sense of duty. But it wasn’t until he started working as a cop that Crystal felt like he had found his calling.

He stood out from the start. Crystal was honored with the prestigious Police Commissioner’s Award upon graduating from the academy and was the first member of his class to make detective.

“I was just so motivated,” Crystal said. “All I could think about was this was my shot. I’m going to do it right.”

That conviction would be tested on the night of Oct. 27, 2011.

It was about 8 p.m. when Crystal, along with other members of his Violent Crime Impact Section, witnessed a suspected drug transaction on Baltimore’s east side.

Upon seeing the cops, one of the men, identified as Antoine Green, threw his drugs to the ground and sprinted away. The officers gave chase but Green got away.

Minutes later, a 911 call came in from a woman who reported a man kicked in the back door of her house.

Cops swooped in on the home and arrested Green. After arriving at the scene, Crystal learned that the home belonged to the girlfriend of a city cop named Anthony Williams, who he had never met.

The off-duty Williams showed up after the suspect had already been cuffed and driven away in a police van.

Crystal says he saw Williams have a quick conversation with Sgt. Marinos Gialamas. “I’ll take care of it,” Gialamas told Williams, according to Green.

Moments later, the police van returned and Green was led back into the home.

“I was thinking to myself, ‘What the hell?’” Crystal said. “I was baffled.”

Crystal testified that Williams dragged Green into the back of the house where he began beating the handcuffed suspect.

“I can hear the assault,” Crystal said. “I hear the banging. I hear the guy hit the floor.

“A couple minutes later, they bring the guy out,” Crystal added. “His shirt’s ripped. He’s having trouble standing. Later on, I found out his ankle was broken. It was obvious not just to any cop but to any person that saw it what had just transpired.”

The battered Green was led back into the police van and driven away.

“It was wrong what happened,” Crystal said. “I felt sick about it.”

That night, Crystal called his parents and told them what happened. The two former cops didn’t mince words. “You know what you’re going to have to do,” his mother, Madeline, told him.

“Once you lose your integrity,” said his father, Robert, “it’s gone.”

Crystal didn’t hesitate. He called his sergeant and explained what happened.

Crystal said his superior took the opposite stance from his parents. “If you snitch, your career is done,” Crystal recalled him saying. “Nobody’s going to work with you.”

The young detective couldn’t believe what he was hearing. But it didn’t stop him from reporting the beatdown to prosecutors.

I was shooting through this place with a rocket strapped to my back. Now, because of doing the right thing, doors are slamming.

Somehow, word got out immediately. Days after his meeting with prosecutors, Crystal said, a sergeant called him “a snitch” and left a hand-drawn picture of a rat and cheese on his desk.

“I’m not a sensitive guy,” Crystal said. “It didn’t necessarily bother me right away. I said to myself, ‘If this is the worst that happens, I can live with it.’ But from there, it snowballed.”

The guys in his unit refused to ride with him. To his face and behind his back, officers called him a rat and a snitch.

“People don’t like you, and you need to watch your back,” one officer told Crystal, according to his lawsuit.

The harassment escalated after Gialamas and Williams were criminally charged in the assault in Oct. 2012, according to Crystal’s lawsuit.

Out of the blue, a sergeant called him and said: “You better pray to God that you’re not the star witness,” Crystal recalled.

Now officers were no longer backing him up on the streets. On two separate occasions, Crystal said, he called for backup while pursuing drug suspects but nobody showed up.

The second time it happened, Crystal was in the process of arresting a suspected drug dealer and buyer. Suddenly, his supervisor called his cell phone and “gave him a direct order to return to the district and that he would not be given backup,” the lawsuit says.

Crystal had no choice but to let the suspects go.

“Nobody wants to ride with you,” a detective later told him, according to the suit.

Around the same time, Crystal was told he was being demoted back to patrol.

And his security clearance was inexplicably revoked, forcing him to stop working on an assignment with the FBI.

Instead of going after drug kingpins and gun traffickers, he was put on a midnight-shift burglary detail.

“It was like being kicked in the gut,” Crystal said. “I was shooting through this place with a rocket strapped to my back. Now, because of doing the right thing, doors are slamming.”

Still, nothing could have prepared Crystal for what happened the day after Thanksgiving 2012.

He and his wife returned home to find a dead rat on the windshield of his car. As sickening a sight as it was, Crystal was more bothered by the message behind it: We know where you live.

“I was trying to be strong for my wife because she was hysterical,” Crystal said.

Crystal said he sought help from his union, but an official told him his best option was to find a different department. By that time, Crystal and his wife had moved in with her parents out of fear of retaliation. “It was like I was a cop going into the witness protection program,” Crystal said.

The trial over Green’s assault got underway in Feb. 2014. Crystal testified against both Williams and Gialamas. By that point, he had nothing to lose.

A Baltimore jury found Williams guilty of assault and obstruction of justice and Gialamas guilty of misconduct.

Williams was sentenced to 45 days behind bars. Gialamas received probation. Both men are no longer working for the department, a spokesman said.

“This case was very troubling to this court,” a Baltimore judge M. Brooke Murdock said before handing down the sentence to Williams. “The community has a right to expect the police will respect the law.”

Crystal had hoped the end of the trial would mark the end of the abuse. He was wrong.

Somebody made a fake Twitter account in his name and started tweeting reporters that he was cheating on his wife. He was bounced around to different patrols and made to feel like a “leper.” And an internal investigation that Baltimore Police Chief Anthony Batts promised would “get to the bottom of what happened to him” went nowhere, Crystal said.

Beaten down by the abuse, he resigned from the force in August.

The suit Crystal filed on Dec. 22 seeks at least $2.5 million and names the department, Chief Batts and his former supervisor Sgt. Robert Amador.

“It seems to me that the Baltimore Police Department and any police department across the country needs individuals like Joe Crystal,” said his lawyer, Don Discepolo. “He did stand up for what he thought was right and he was persecuted for it.”

Crystal and his wife now live in Florida where he’s working as an officer with the Walton County Sheriff’s Office.

Crystal understands that some might draw parallels between his case and the coordinated displays of disrespect shown to Mayor de Blasio by NYPD officers at the funerals of slain cops Wenjian Liu and Rafael Ramos.

But Crystal doesn’t see a connection.

“I see people here as they’re hurting and upset right now at the loss of two of their own,” Crystal said. “I saw what happened to me as somewhere along the line we lost our way.

“What I saw was criminal. What I see here is an emotion,” Crystal added. “And those are two very different things.”

He tried for months to get a law enforcement job near Maryland but found no takers.

“Looking back, I still can’t fathom what happened,” Crystal said. “How do you honestly expect people to have faith, to trust the cops, when they let this happen?”