PORTLAND, Maine — A local man was sentenced Monday in U.S. District Court to 14 years in federal prison for robbing two banks and three credit unions in Cumberland County last year.

Jimmy Odong, 26, of Portland also was ordered to pay more than $26,000 in restitution, according to a press release from the U.S. attorney’s office.

Earlier this year, Odong pleaded guilty to robbing the University Credit Union in Portland on May 14, 2015, TruChoice Federal Credit Union in Portland on May 26, 2015, CPort Credit Union and Bank of America, both in Portland, on June 19, 2015, and Key Bank in Freeport, Maine, on July 17, 2015.

Odong said at his sentencing that he spent some of the money on drugs, on a hotel room after the last robbery and on taking friends to Six Flags New England in Agawam, Massachusetts, according to the U.S. attorney’s office.

He was captured on bank security cameras wearing a hat or wig that partially disguised his appearance, the press release said. He demanded cash from tellers and brandished what appeared to be a semiautomatic handgun.

He was arrested on July 23, 2015, in Portland for the Key Bank robbery after Odong’s partial palm print was recovered from a stolen vehicle he used in the robbery, according to court documents. About $1,180 was recovered when Odong was arrested.

Another $3,300 was seized on Dec. 17, 2015, from Odong’s brother, Alfred Odong, 20, of Portland. The money was stained with dye from an exploding pack a Key Bank teller hid in the cash she gave him.

Alfred Odong was charged in March with being in possession of bank robbery proceeds. The charge was dropped Monday after his brother was sentenced.

Jimmy Odong faced up to 20 years in prison and a $250,000 fine for each robbery. His plea agreement with federal prosecutors called for him to be sentenced between 12 years and three months and 14 years in federal prison for all five robberies.

After completing his sentence, Odong faces deportation. A permanent resident of the United States, he came to this country when he was 9 from what is now South Sudan.