BANGOR, Maine — A local transient who pleaded guilty to a felony robbery charge after taking a man’s medical marijuana was sentenced Tuesday to six years in prison, with all but two years suspended.

John Branscomb, 28, also was ordered to undergo four years of probation after his release, pay $5,000 in restitution, have no contact with his victim, keep clear of alcohol and drugs and undergo counseling, according to Penobscot County District Attorney R. Christopher Almy.

According to police, Branscomb and two other people worked together to rob a man of his medical marijuana with a machete and burglarize another man’s home.

Branscomb’s alleged accomplices, Rachel Burrows, 28, of Glenburn and Steven A. Cronk, 30, of Hermon, also were arrested and charged in connection with the robbery and burglary, according to published reports.

Branscomb and Cronk both were indicted on charges related to the incidents on Oct. 29 of last year.

Branscomb was indicted on robbery and burglary charges. Cronk was indicted on two counts each of burglary and theft by unauthorized taking and one count each of robbery and stealing drugs. Burrows was not on the indictment list.

Almy said Tuesday the burglary charge against Branscom was dismissed.

Branscomb and Cronk broke into a house in Hermon last July and robbed a man of the medical marijuana he was licensed to grow and between $400 and $500 cash, according to court documents. A machete owned by Burrows was allegedly used to threaten the victim. Burrows allegedly drove the getaway car while the two men went into the home.

The victim did not report the crime until Aug. 4.

On July 29, Cronk and Branscomb allegedly burglarized a home in Stetson and stole medicine and a gun. Again, Burrows drove the getaway car, police said.