A 20-year-old man charged with robbing a Ladson gas station Sunday had recently been released from state prison on other felony charges.

Jacob James Obrien of Trolley Road in Summerville is charged with armed robbery, possession of a firearm during a violent crime and simple possession of marijuana. He was being held at the Charleston County jail.

A 54-year-old clerk at Petro Express on Ladson Road told Charleston County sheriff’s deputies he was robbed shortly after 3 a.m. by three men wearing masks and carrying guns. The robbers forced him to open the register, and they escaped with about $50 and a case of beer, deputies said.

The clerk described the robbers as three black men in dark clothing, but surveillance video showed one of the men was white, Sheriff’s Maj. Eric Watson said.

On Monday, a witness told investigators that Obrien had talked about robbing Petro Express, and the witness shared details that would have only been known by the robbers and the clerk, according to an arrest affidavit. The following day, investigators located Obrien, who had a bandana with the same design as one seen in the robbery video, the affidavit stated.

Detectives also recovered a pistol from Obrien’s home that is believed to be one of the guns used in the holdup, the affidavit stated.

During a bond hearing Wednesday morning, Obrien told a judge he just got out of prison two weeks ago. He said detectives picked him up on a warrant for armed robbery but he doesn’t know what they are talking about. The judge set his bail at $200,620.

Obrien has a criminal record dating to 2009, when he was convicted of huffing hydrocarbons, according to State Law Enforcement Division records. He is currently on probation on charges of grand larceny, failure to stop for blue lights, malicious injury to property and contempt of court, SLED records show.

The other two suspects in the holdup remain at large, Watson said.

Natalie Caula contributed to this report.