Harrowing police bodycam video shows the rescue of a suicidal man teetering on the side of a bridge in New York City.

"We’re here for you," Officer Eleodoro Mata can be heard telling the man in a 40-minute ordeal captured on bodycam video. "Everybody’s here for you. We’re gonna help you."

The NYPD praised both Mata and his partner Carl Fayette for their roles in the dramatic rescue, which prompted cheers from onlookers when emergences services officers wearing safety harnesses finally grabbed ahold of the man and brought him to safety.

You are beautiful, brother – please don't give up on me.

— NYPD Officer Carl Fayette

"Life is beautiful, brother," Fayette says repeatedly to the victim, seen leaning over the edge of a bridge.

HERO COPS DRAW WOMEN'S ATTENTION AFTER DRAMATIC RESCUE OF AUSTIN MAN FROM BURNING TRUCK

NYPD Officer Eleodoro Mata gestures on other side of fence from suicidal man

NYPD Officer Eleodoro Mata gestures as he and partner Carl Fayette try to reassure a man standing on the edge of a bridge in New York City on Oct. 5, 2023. (NYPD/BODY CAMS+/TMX)

"You are beautiful, brother – please don't give up on me."

Moments before his safe rescue, the man crouched over, precariously leaning over the edge of the bridge.

WATCH: Police officers talk man down from the edge

Earlier in the video, Fayette confessed to the man that he has been in a similar situation himself.

"I've been in your shoes, man," he says. "It's not worth it…there are solutions."

CAREER CRIMINAL ARRESTED IN NYC SUBWAY SHOVE THAT NEARLY KILLED COMMUTER ONCE THREW URINE ON OFFICER

Police members comfort an officer who broke down after his role rescuing a suicidal man

After the ordeal, NYPD members comfort Officer Carl Fayette, who had just helped rescue a suicidal man from the side of a bridge in New York City on Oct. 5, 2023. (NYPD/BODY CAMS+/TMX)

"There is a way to ensure you get out of this situation," he adds.

When the ESU officers grabbed the man, Fayette is seen reeling away from the ledge, toward a squad car, where he crouches down and puts his face in his hands. Within seconds, he breaks down in tears.

"Police officers frequently interact with people having the worst day of their lives," the NYPD said in a statement shared to X. "Two weeks ago, Officers Fayette & Mata talked to a distraught man in crisis for nearly 40 minutes until ESU officers rescued him."

Officers Fayette and Mata pose in Precinct building

Officers Fayette and Mata commended by their precinct commander for their efforts rescuing a man from the side of a bridge. (NYPD 26th Precinct/X)

CLICK HERE TO GET THE FOX NEWS APP

Both officers work for the NYPD's 26th Precinct, where their commander praised them on X last week, before the bodycam video had been made public.

"They spoke to the man with genuine empathy to let him know they cared and that help was available, & with the assistance of our @NYPDSpecialops, they got him help," he wrote.

The National Suicide and Crisis Lifeline can be reached by dialing 988.