Keith Shaver, 18, and Rashard Stroman, 19, both of Springfield, pleaded guilty to armed assault with intent to rob, assault and battery with a dangerous weapon, carrying a firearm without a license and larceny from a person in front of Hampden Superior Court Judge Bertha D. Josephson.

Shaver was sentenced to a three-year term in the Ludlow jail, followed by three years probation.

Stroman was sentenced to a 2½-year term followed by three years probation.

Both men get credit for 320 days they have spent in jail awaiting trial.

At the time of the crime, police said one of the suspects lured the manager outside the security gate on the pretext of wanting a room.

The manager was pistol-whipped and a knife he had on his person was stolen.

Assistant District Attorney Maida Wassermann told Josephson she felt it was important that the probation term be put on the most serious charge, the armed assault with intent to rob.

She said that “takes into consideration that, if these individuals mess up,” they could face 20 years in prison.

“The commonwealth essentially is giving them a shot” saying they can do their jail time and successfully complete probation they will not face a long state prison term, Wassermann said.

Both young men had family members in the courtroom.

Daniel R. Bergin, Shaver’s lawyer, said given his client’s young age the aim was to avoid state prison. “He’s a good young man your honor,” Bergin said, saying Shaver is “emotionally immature.”

Gopal Balachandran, Stroman’s lawyer, said his client was about to finish high school when he committed the crime at the River Inn.