Officials from the state Department of Corrections and Rehabilitation said they took 21-year-old Shalom Mendoza into custody at a fast food restaurant without incident. He was taken to the Salinas Valley State Prison.
A resident alerted authorities after seeing Mendoza at the restaurant in Paso Robles, more than 200 miles (320 kilometers) southeast of the prison.
He's suspected of carjacking a vehicle in a store parking lot less than a mile from the prison after fleeing a work assignment outside the prison walls. He was reported missing just after 9:30 p.m. Wednesday.
San Rafael police have said a man with a similar physical description to Mendoza motioned to the victim as if he had a weapon under his shirt. He threatened to kill her and demanded her car keys, but she wasn't injured.
The car was found abandoned Friday near a freeway north of Paso Robles. Prosecutors will determine whether to charge Mendoza with escape and carjacking, the corrections department said in a statement.
Mendoza got a five-year sentence in 2017 for using a deadly weapon during a Los Angeles County carjacking and evading or trying to evade police while driving recklessly.
He arrived at San Quentin in April and was assigned to a minimum-security inmate work crew in May, authorities said. Mendoza lived in a dormitory behind a security fence, but he was with a work crew outside the prison fence when he walked away, officials said.
San Quentin is California's oldest prison, opening in 1852, and houses more than 4,100 inmates, including those on death row.
It isn't unusual for inmates outside secure areas to walk away, and most are quickly caught. Far more uncommon are escapes from walled or fenced prisons.