This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

NEW YORK — The police officer who fatally shot Ramarley Graham, an unarmed teenager, resigned from the NYPD Sunday night to avoid being fired following a disciplinary trial.

Richard Haste submitted his resignation just a day before Police Commissioner James O’Neill was going to fire him. Haste quit after he was informed on Friday that the Department Trial Commissioner found him guilty on all counts.

“Commissioner O’Neill has fully concurred with the findings and recommendations of the Trial Commissioner,” a statement from the NYPD read Sunday night.

Haste followed Graham into his grandmother’s home and into the bathroom in the Wakefield section of the Bronx on Feb. 2, 2012.

The former NYPD officer kicked down the bathroom door and fired his weapon when he saw Graham motioning to pull something out of his waistband.

Haste said he believed Graham had a gun on him. No gun was recovered from the scene.

He initially faced a criminal manslaughter charge in Graham’s death but the criminal case was tossed due to procedural error. A second jury and federal prosecutors also declined charging him.

“He was exonerated by both a state and federal grand jury,” said Haste’s lawyer, Stuart London. “The New York City Police Department Firearms Discharge Review Board found the shooting to be justified. All of officer Haste’s actions were performed in good faith. He never should have been forced to resign based on tactics alone.”

Graham’s shooting death in 2012 came before a spate of highly publicized killings by police, such as the deaths of Michael Brown, Walter Scott and Eric Garner, that helped propel the topic into the spotlight. But Graham’s family and friends have been a constant public presence over the past five years, demanding justice for the 18-year-old.

Graham’s mother, Constance Malcolm, said Sunday that the city let Haste off the hook by allowing him to resign instead of being fired. She blasted the department for failing to schedule disciplinary proceedings for other officers involved.

“Every step of the way, the mayor and NYPD have dragged their heels and have refused to hold officers accountable for murdering my son,” she said. “How is my youngest son supposed to trust and believe in cops when he saw they murdered his brother in front of him and there is zero accountability?”

In his testimony during the departmental trial, Haste, now 35, recounted how he got out of his police van during a drug probe in Graham’s Bronx neighborhood and followed the teenager, suspected on police radio chatter of having a gun, into his apartment building.

After Haste and his partner broke down the door of Graham’s home, the officer said he saw Graham sidestep into a bathroom, and he leaned inside to face him.

Haste testified that he yelled, “Show me your hands!” but Graham instead reached deeper into his pants and yelled obscenities.

“I thought I was about to be shot,” Haste said. “I expected to be dead.”

The family settled a wrongful death lawsuit against the city for $3.9 million.

Democratic Mayor Bill de Blasio released a statement late Sunday on Haste’s resignation.

“Ramarley Graham was a son, a friend and, most importantly, a young man with his whole life left to live,” de Blasio said. “Nothing can take away the profound pain left after his loss, but I hope the conclusion of this difficult process brings some measure of justice to those who loved him.”

De Blasio added that his administration has taken steps to strengthen the relationship between police and the community and increase transparency.

The Associated Press contributed to this report.