NYPD officer Richard Haste, who shot and killed Bronx teenager Ramarley Graham nearly five years ago, is being made a scapegoat and risks getting fired because of political pressure on the department, a defense attorney said Monday.

In closing arguments in the departmental trial of Haste, accused of using improper police tactics in the Feb. 2, 2012, shooting, his lawyer, Stuart London, said Graham’s refusal to obey officers’ orders led to his death.

“Had Ramarley Graham listened to the commands we would not be having this trial,” London said.

Unspecified “outside influences” were the reason the NYPD was trying to make an example of Haste, London said, adding that his client is the victim of “Monday morning quarterbacking” by his department superiors. Haste faces no criminal liability in the case but if NYPD Deputy Commissioner Rosemarie Maldonado finds him guilty, she could recommend his firing to Police Commissioner James O’Neill.

In her summation, NYPD attorney Nancy Slater portrayed Haste as a reckless cowboy who disregarded sound police training.

“Poor, poor tactics,” Slater said repeatedly in her closing remarks to Maldonado.

Haste shot Graham one time in the bathroom of the 18-year-old’s apartment on East 229th Street. Police had pursued Graham during a drug surveillance operation and mistakenly believed he was armed with a handgun. Haste followed Graham into the building, gained consent to enter, and went upstairs with his partner, Officer John McLoughlin, who then kicked open the door to a second-floor apartment Graham had entered.

Once inside, Haste has testified, he repeatedly shouted for Graham to “show me your hands,” a command the teenager answered with expletives before entering the bathroom. Haste said he fired when Graham reached further down into his waistband, believing the teenager was going for a weapon.

Slater put the blame for Graham’s death on Haste, who she characterized as “overzealous” in his attempt to make a gun arrest. In doing so, Slater said, Haste disregarded police protocol for handling a barricaded suspect — calling for backup from emergency service cops.

“The utter recklessness of that breach astonished me,” she told Maldonado.

At the end of summations, supporters of Graham’s family stood up in the courtroom, holding signs and shouting “fire Richard Haste, fire Richard Haste,” before Maldonado banged her gavel.

The commissioner reserved her decision, which some legal experts think could take up to three months. She set Feb. 3 as the due date for legal briefs.

The case has been politically charged, with Graham’s family over the last five years pushing City Hall and the NYPD for Haste’s firing. The family settled a lawsuit with the city in 2015 for $3.9 million.

Haste’s trial has shown that police procedures governing the precinct drug unit appear to have been routinely ignored, including the requirement that cops get training in street narcotics operations. Haste received no such training.

Arguing for a result short of Haste’s termination, London cited two past cases in which cops accused of poor tactics leading to death weren’t fired but faced discipline through lost vacation, or even received a favorable dismissal of the department charges.