ROCHESTER, N.Y. — It will be a final goodbye on Friday to NYPD Officer Jason Rivera, who was shot in the line of duty with his partner last week.

Thousands lined the streets as his casket was brought into St. Patrick's Cathedral Thursday for his wake.

Rivera and his partner, Officer Wilbert Mora, both new to the force, were fatally wounded when a gunman ambushed them in an apartment as they responded to a family dispute.

Their deaths come just a few weeks past a deadly year for law enforcement in 2021. A total of 62 officers were shot and killed in the line of duty, up 38% from the year before. Hundreds of officers were shot, including three on Thursday in a dramatic shoot-out in Houston.

That violence is not far from the minds of police officers everywhere, including in Rochester.

“You have to watch out for everything because you never know when something's gonna happen," said RPD Investigator Ebony Brown. "And it's ... it's sad to say, but you kind of have to be on guard 24/7 when you're in that patrol car and when you're wearing that uniform.”

“As a cop, it's always in the back of your mind that something bad could happen," said Commander Jeffrey LaFave. "And what keeps us moving forward is we try not to think about it. Because if we did, it essentially would debilitate us; we would be ineffective at our job.”

Spectrum News 1 reporter Wendy Wright takes a closer look at officer safety in her story coming up later on Friday.