Boone gave Wilson credit for the time he served in jail awaiting Tuesday's hearing.
Wilson, 35, of 436 N. Jonathan St., was given the 15-year maximum sentence but Boone suspended all but the 10 years, court records said.
No one was injured in the robbery in which $1,470 was taken, according to court records.
The robber entered the branch at 1:05 p.m. and passed a note demanding cash to a teller, court records said. The robber did not display a weapon or indicate that he had one during the three or four minutes he was inside the bank.
After the teller handed over the money, the man ran to Alexander Street. In an alley between Franklin and Washington streets, he met an accomplice.
The accomplice was described as an Hispanic man, 5 feet 6 inches tall, of medium build and with a slight growth of facial hair.
Police believe the robber changed clothes in the alley before fleeing south on Alexander Street with the Hispanic man.
A duffel bag containing clothing similar to that worn by the robber while he was in the bank was found in the alley.
The accomplice was never caught, police said Wednesday.
Wilson was paroled from the Roxbury Correctional Institution in June 1997, according to prison records.
Assistant Washington County State's Attorney Joe Michael said Wilson's priors included convictions for three sexual offenses.
The same Hagerstown Trust Co. branch was previously robbed on Feb. 24, 1997. No one was ever charged in that robbery.
It was hit again on Oct. 23, 1997. In that case, the robber was apprehended and sentenced to five years in prison.
Since then, the same branch was robbed on March 15 and a man is in custody.