A police officer in Mesa, Arizona, was "in the right place at the right time" to help save a baby who had stopped breathing on the platform of a light rail, authorities said Wednesday.

Officer Shaquille Perez was dealing with a sleeping, non-compliant passenger on the light rail on July 23 when a screaming mother caught his attention, the Mesa Police Department said.

"I heard screaming, so I walk over, and when I peep out this way from the other side where the train’s at, mom comes running up to me screaming for help," Perez said.

Perez’s body-worn camera footage shows him take the unresponsive baby, turn him over and begin patting the child’s back.

EAGLES' HAASON REDDICK BLITZING FOOD INSECURITY IN NEW CAMPAIGN: ‘IT’S A BLESSING'

family running baby to officer

A screaming mother ran the unresponsive child over to the officer on the platform of a light rail. (Mesa Police Department)

As Perez worked on the child, he said that a man who told him he was a retired paramedic offered to help.

officer patting baby's back

Officer Shaquille Perez took the child and began patting his back to help him breathe. (Mesa Police Department)

"He took the baby from my arms, and we put him in the backseat of the squad car under some A/C, and baby was breathing," Perez said. 

retired paramedic holding baby in police car

A retired paramedic approached Officer Shaquille Perez and offered to help. (Mesa Police Department)

The child can be heard on video giving a loud cry while in the arms of the retired paramedic, who then began to soothe the baby.

UTAH POLICE ‘FILL IN DADS’ WALK SON OF FALLEN OFFICER TO FIRST DAY OF KINDERGARTEN

The Mesa Police Department wrote in a caption for the bodycam video that Perez was "in the right place at the right time" 

Mesa Police Officer Shaquille Perez

Officer Shaquille Perez said helping to save the child's life was an "amazing feeling." (Mesa Police Department)

"It’s an amazing feeling to know I was able to intervene and help potentially save that baby’s life," Perez said.

CLICK TO GET THE FOX NEWS APP

Paramedics arrived and evaluated the child. Police said the baby is now safe.