AUGUSTA – An Augusta man pleaded guilty Friday to robbing a city pharmacy last year and then barricading himself inside the store’s bathroom and threatening to destroy the building.

Dylan Karczewski, 20, entered the plea in Kennebec County Superior Court, and his case was continued for sentencing later.

Karczewski robbed the Rite Aid store at 2007 North Belfast Ave. about 5 p.m. on Oct. 23, threatening to hurt a pharmacist while demanding oxycodone and syringes.

Police said Karczewski then fled to the store’s bathroom and locked himself inside.

He told responding police that he had chemicals and would “burn this place down,” according to a court affidavit filed by Augusta police Officer Nathan Walker.

A standoff lasting more than 30 minutes ensued as police viewed store surveillance video to confirm that Karczewski was armed with neither weapons nor an explosive chemical.

The standoff led to the evacuation of the store’s customers and employees.

Karczewski used the needles to inject himself with the drugs while in the bathroom, police said.

Officers tried to open the door with a key, and Karczewski yelled his threat to destroy the building.

He was taken to the hospital after police broke into the bathroom and arrested him without incident.

Karczewski graduated in June 2011 from Cony High School, where he was a starter on the hockey team.

Karczewski was arrested on a warrant on May 31, 2011.

A police report about the warrant arrest says officers were responding to a report of terrorizing at a Riverside Drive store and found him there.