NEW YORK (AP) — The 22-year-old New York City police officer who was shot to death while responding to a call in a Harlem apartment came from an immigrant family and grew up in a community with strained police relations, but joined the force to make a difference in the “chaotic city,” he once wrote.

“I know that something as small as helping a tourist with directions, or helping a couple resolve an issue, will put a smile on someone’s face,” Jason Rivera wrote to his commanding officer in 2020 when he was a probationary police officer.

Rivera and Officer Wilbert Mora were shot Friday night while answering a call about an argument between a woman and her adult son. Mora, 27, suffered a serious head wound, police said.

The medical examiner ruled Rivera’s death a homicide on Saturday after an autopsy found he died from gunshot wounds to the head and torso.

Mora was still “fighting for his life” on Saturday, said Mayor Eric Adams. Cardinal Timothy Dolan, the Archbishop of New York, visited Mora and his family in the hospital and gave the wounded officer a blessing, according to a spokesman the archdiocese.

The man police say shot them, Lashawn J. McNeil, 47, also was critically wounded and hospitalized, authorities said. Police declined to comment later Saturday about the conditions of Mora and McNeil.

The shooting is the latest in a string of crimes that have unnerved the nation’s largest city.

In the three weeks since Adams took office, a 19-year-old cashier was shot to death as she worked a late-night shift at a Burger King, a woman was pushed to her death in a subway station, and a baby was critically injured when she was hit by a stray bullet as she sat in a parked car with her mother. With the Harlem shooting Friday night, four police officers had been shot in as many days.

And the city is recovering from its deadliest fire in three decades, a Bronx apartment blaze that killed 17 people.

“It’s hard to believe, but it’s only been three weeks, and it has been nonstop since then,” Adams told residents at a gun violence roundtable Saturday. “But I want you to know in a very clear way that I am more energized. I’m not tired. I’m not stressed out.”

Rivera joined the force in November 2020.

Growing up in Manhattan’s Inwood neighborhood, he noticed tensions with police, according to a brief essay titled “Why I Became a Police Officer,” a copy of which was obtained by The Associated Press.

“I remember one day when I witnessed my brother being stopped and frisked. I asked myself, why are we being pulled over if we are in a taxi?” he wrote. “My perspective on police and the way they police really bothered me.”

But eventually he noticed the department working to improve relationships, and he wanted to be involved.

“I realized how impactful my role as a police officer would go in this chaotic city,” he wrote.

Anti-domestic violence advocate Stephanie McGraw, who knew Rivera through her work with the precinct, said he was energetic and enthusiastic.

“He was so eager to make a difference in this community,” said McGraw, founder of We All Really Matter.

Mora is similarly devoted to the community, she said.

Police said the gun used in Friday night’s shooting, a .45-caliber Glock with a high-capacity magazine capable of holding up to 40 extra rounds, had been stolen in Baltimore in 2017.

Adams and Gov. Kathy Hochul both said federal authorities need to do more to round up stolen guns like the one used in the Harlem shooting. Hochul, at an appearance in Buffalo on Saturday, called it a “scourge of illegal guns on our streets.”

“We’re removing thousands of guns off the street,” Adams told reporters Saturday. “But there’s an endless flow that continues to come through our city borders.”

Adams said a woman who made an emergency call Friday said she was ill and that her son who had come up to take care of her had become “problematic.” Adams said the woman did not specify the problem.

Authorities said three officers went to the apartment after the call came in. The officers spoke with the woman and another son, but there was no mention of a weapon, police said.

After Rivera and Mora walked from the front of the apartment down a narrow hallway to check on McNeil, he swung open a bedroom door and began shooting, police said. Both officers were gunned down before they could pull their weapons and defend themselves, police said.

As McNeil tried to flee, a third officer who had stayed with McNeil’s mother in the front of the apartment shot at McNeil and wounded him in the head and arm, NYPD Chief of Detectives James Essig said.

“This was just not an attack on these brave officers,” Adams said Friday night. “This was an attack on the city of New York.”

Mora has been with the NYPD for four years.

McNeil was on probation for a 2003 drug conviction in New York City. He also had several out-of-state arrests. In 1998, he was arrested in South Carolina on suspicion of unlawfully carrying a pistol, but records show the matter was later dismissed. In 2002, he was arrested in Pennsylvania on suspicion of assaulting a police officer, Essig said.

___

Associated Press writers Michael Hill in Albany, New York, and Kathleen Foody in Chicago contributed to this report.