LODI, Calif. — In a dramatic rescue captured on body-cam video Wednesday, a California police officer pulled a man stuck in his wheelchair on train tracks out of harm’s way just in the nick of time.

The incident happened around 8:44 a.m. in Lodi, about 35 miles south of Sacramento. Officer Erica Urrea saw the 66-year-old man stuck on the tracks and then noticed the railroad crossing arms come down and saw the train approaching, police said.

She jumped out of her patrol car, raced toward the man and yanked him out of his wheelchair, as they both fell to the ground. The freight train came barreling by just a few seconds later.

The man suffered a leg injury and was transported to a local hospital for treatment, police said. It is unclear how long he was stuck on the train tracks.

“Officer Urrea risked her own life to save another and her actions prevented a tragedy today,” the Lodi Police Department wrote on its YouTube page. “We are extremely proud of Officer Erica Urrea and her heroism.