A Maryland man carjacked a woman just 30 minutes after he was released from prison, according to police.

Guaymar R. Cabrera-Hernandez, 24, of Hyattsville, was charged Friday with armed carjacking, armed robbery and first-degree assault.

Cabrera-Hernandez was released from the Montgomery County Detention Center Monday, Montgomery County Police said. Less than a mile away, Cabrera-Hernandez found a 38-year-old woman sitting in her car in the Islamic Education Center parking lot on Montrose Road in Potomac, Maryland, police said.

The victim saw Cabrera-Hernandez enter the parking lot, disappear and reappear moments later, approaching her lowered driver’s side window, police said.

Cabrera-Hernandez held a knife and brick in his hands, police said. He put the knife to the victim’s throat and demanded she get out of the car, police said.

As she got out of the car and moved away from Cabrera-Hernandez, he threw the brick at her, police said. He then drove from the parking lot.

Investigators checked with the detention center about releases, and the victim identified Cabrera-Hernandez from a photo, police said.

On Wednesday, Cabrera-Hernandez carjacked another driver on Loughboro Road in Northwest Washington.

After a brief police chase, Cabrera-Hernandez crashed into a wooded area near River Road and Little Falls Parkway in Bethesda, police said. He took off into the woods and crossed back into D.C., where police took him into custody, police said.

He admitted to the Potomac carjacking incident when detectives interviewed him, police said.