PHILADELPHIA (CBSNewYork/AP) — A corrections officer leaving work for the day shot and critically injured a just-released inmate who authorities say attacked the guard in the parking lot of a prison in Philadelphia Friday night.

Police say 26-year-old Jamal Bennett attempted to carjack the 66-year-old guard just before 11 p.m., right after the guard finished his shift at Curran-Fromhold Correctional Facility in the city’s Holmesburg section.

More From CBS Philly

The two men fought next to the officer’s vehicle until the guard pulled his personal weapon and opened fire, striking Bennett in the chest.

The recently-freed inmate was rushed to Jefferson Torresdale Hospital in critical condition but was expected to survive. The officer suffered minor injuries to his head and neck.

“It seems like he was starting his life of crime over again within minutes of being released, attempting to carjack this off-duty correctional officer,” Philadelphia Police Chief inspector Scott Small told CBS Philly. “So it is somewhat bizarre.”

Bennett had just been released from custody on a probation violation for a weapons charge. Court documents don’t list an attorney representing him.

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)