NYPD Officer Jason Rivera funeral service

A funeral mass was held Friday at St. Patrick's Cathedral for New York City Police Officer Jason Rivera. Thousands of law enforcement converged along with family, friends and the public to pay their final respects to the married, 22-year-old who was gunned down in Harlem last week.

Roman Catholic Cardinal Timothy Dolan presided over Rivera's service, held in Spanish and English in recognition of his Dominican heritage. Many of the city’s top leaders were attending, as uniformed officers filled the pews.

Rivera and his partner, Police Officer Wilbert Mora, were  shot when they responded to a mother's call for help with her adult son in Harlem last Friday.  Mora's funeral would take place week, also at St. Patrick's.

"It doesn't really matter what uniform we wear," said Master Police Officer Tammy Russel. "We're from Fairfax County, Virginia, but we're here in New York City. These are all our brothers and sisters. ... Sadness all around."

Get breaking news alerts in the free FOX5NY News app!  |  Sign up for FOX 5 email newsletters

Throughout the week, friends and fellow police officers remembered Rivera and Mora as caring and dedicated. Both grew up in the city's ethnic enclaves and, by many accounts, had hoped to help the department build bridges with the community.

The gunman, who was shot by a third officer, died earlier in the week. Authorities are still investigating why he fired at the officers.

A viewing service was also held at St. Patrick's Cathedral on Thursday. 

"It's an emotional time," said retired NYPD Officer Sean Flanagan, who played bagpipes outside the cathedral. "We honor our own, we take care of our own."

There was heavier-than-normal traffic in the area around the cathedral, which is located on 5th Avenue between 50th Street and 51st Street, on Friday. Authorities closed streets and blocked sidewalks to accommodate police and other government vehicles and thousands of police officers.

Growing up in the Inwood section of Manhattan, Rivera noticed tensions with police, according to a brief essay titled "Why I Became a Police Officer." In that essay, he wrote about how he was bothered by witnessing his brother being stopped and frisked. 

But his attitudes changed when he also saw how the department was trying to improve relationships with communities.

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

Rivera joined the police department in November 2020.

Service for Mora will also be held at St. Patrick's Cathedral.

Gov. Kathy Hochul directed that flags on state buildings be lowered to half-staff in honor of Rivera and Mora. 

"The losses of Officer Rivera and Officer Mora are felt widely and deeply by all New Yorkers — my thoughts are with their families and loved ones," Hochul said in a statement. "Today we mourn as they are laid to rest, but tomorrow we must work to eradicate the epidemic gun violence has become in our communities."

Flags will be lowered to half-staff from sunrise on Friday, Jan. 28, the day of Rivera's funeral, until sunset on Wednesday, Feb. 2, following Mora's funeral service, according to Hochul's order.

Police Officer Jason Rivera (NYPD via PBA)

With The Associated Press.

RELATED: NYPD escorts body of slain rookie officer Jason Rivera

RELATED: After NYPD officer shot, Adams to lay out plan to address gun violence