State and Wilson Streets are blocked off in Brewer while multiple police respond to an active situation at the Village Green Motel in this BDN file photo.

A man arrested last fall after a two-hour standoff with police at a Brewer motel was sentenced Tuesday at the Penobscot Judicial Center to 60 days, or time served, in jail after pleading guilty to one count each of criminal threatening and terrorizing, both Class D crimes.

Gary Green, 63, of Brewer was waving a replica of an AK-47 at himself in the parking lot of the Village Green Motel when police from multiple agencies arrived at about 7 p.m. Oct. 4. Police ended the standoff by using non-lethal impact ammunition to disarm Green.

Green had been staying at the motel following a disagreement with a roommate and suffered a mental breakdown that led to the standoff. He was held for 60 days after his arrest at Penobscot County Jail unable to post $5,000 cash bail before he was voluntarily transferred to the Dorothea Dix Psychiatric Center, Green’s attorney, Hunter Tzovarras of Bangor, said late Tuesday.

He underwent treatment at the psychiatric center, Tzovarras said.

“He was off his medication after the incident occurred, but now he’s back on his medication and stable,” the attorney said. “He has an apartment and a treatment plan.”

Tzovarras declined to identify Green’s diagnosis.

Green was released from the jail Tuesday afternoon, according to jail personnel.

In exchange for Green’s guilty pleas, District Attorney Marianne Lynch dismissed a charge of failure to submit to arrest.

Green faced up to a year in jail and a $2,000 fine on each charge to which he pleaded guilty.