PORTLAND — A city man charged with robbing a Westbrook convenience store allegedly tried to leave the Cumberland County Courthouse during a court appearance Tuesday.

Michael Gray, 30, was apprehended in the exit area of the courthouse after walking out of a courtroom while wearing restraints, Maj. Tim Kortes of the Cumberland County Sheriff’s Office said in a news release Wednesday.

The incident occurred at 2:35 p.m., when Gray left the courtroom while a deputy was “addressing another issue with another inmate.” He then ignored commands to stop from the deputy and a court marshal, Kortes said. 

Gray was facing charges of theft, robbery and operating with a suspended or revoked license in connection with a robbery at Duck Pond Variety on Bridgton Road and a nearby car theft, Westbrook police said when he was arrested Monday.

Police were called to the store at 1275 Bridgton Road about 7 p.m. Monday after a masked man robbed the store and fled with cash from the register. Officers found an abandoned vehicle nearby that had been stolen minutes before the robbery from a business parking lot on Riverside Street in Portland.

Shortly after the robbery at the Westbrook store, a car was reported stolen from the driveway of a nearby home, also on Bridgton Road. That car was discovered by Windham police officers who were investigating a disturbance on Haven Road in Windham.

Westbrook police said they arrested Gray after linking him to the robbery and the car discovered in Windham.

Gray was returned Tuesday to the Cumberland County Jail, where police said he was held without bail.

Kortes said the incident is under review and Gray’s security status has been upgraded.

The Portland Press Herald contributed to this report. David Harry can be reached at 780-9092 or [email protected]. Follow him on Twitter: @DavidHarry8.