Slain New York City police Officer Jason Rivera, 22, graduated from high school just five years before a suspect’s bullet took his life on Friday. 

In 2017, the year he graduated from Washington Heights Expeditionary Learning School in New York City, he made an inspirational video for younger students at the high school, urging them to stay focused on their classes. 

"I want to motivate ya," he said in the video which the school shared on its Instagram page this weekend, offering condolences to his family. 

"Jason had a huge, warm smile and a personality to match," the school's post said. "Jason was an exemplary member of our school community, who embodied our core values and lived a life that was dedicated to improving our community. Thank you for your service and sacrifice Jason."

Rivera said in the video when he was a freshman he didn’t have anyone to motivate him. 

"I want y’all to, like, hear me, hear my voice and to know you’re going to get through it," he said. "Ya gotta put in the work. Ya gotta put in 100 percent effort. And ya know what? If it takes some time after school, ya know, so be it, because you gotta do it. If you don’t do it you’re not gonna make it nowhere in life."

"Stay strong," he encouraged the students before signing off.

SLAIN NYPD OFFICER RIVERA CAME FROM IMMIGRANT FAMILY, SAID POLICE 'BOTHERED' HIM GROWING UP IN LETTER

NYPD officers mourns slain fellow officer Jason Rivera (inset). (Patrolmen's Benevolent Association of the City of New York/ NYPD)

Rivera, who joined the NYPD in 2020, died on Friday after he another two other officers responded to a domestic dispute call in Harlem. Authorities say a suspect kicked open a bedroom door at the end of a narrow hallway inside an apartment and opened fire on Rivera and partner Wilbert Mora, 27, who remained in critical condition Saturday night. 

The suspect, Lashawn McNeil, 47, was critically wounded by a third officer as he tried to flee, according to police. 

Rivera wrote in a 2020 essay about why he decided to become an officer that he wanted to improve the relationship between the community and police.

Lashawn McNeil is accused of fatally shooting Officer Jason Rivera and critically wounding Wilbert Mora.  (NYPD)

"Coming from an immigrant family, I will be the first to say that I am a member of the NYPD, the greatest police force in the world," he wrote to the police academy, according to the New York Post. He said he grew up in Manhattan’s Inwood neighborhood where community members often don’t trust the police and an incident where his brother was stopped and frisked when he was younger also soured his view of New York’s Finest.  

Officer Wilbert Mora remained in critical condition Saturday night after he was allegedly shot in the head by Lashawn McNeil Friday.  (NYPD)

CLICK HERE TO GET THE FOX NEWS APP

But, he said over time he saw the department pushing to change how it interacted with the community.

"This was when I realized that I wanted to be a part of the men in blue: [to] better the relationship between the community and the police," he wrote, adding, "Something as small as helping a tourist with directions, or helping a couple resolve an issue will put a smile on someone’s face."