PORTLAND, Maine — A New Hampshire man was sentenced Wednesday in U.S. District Court to 15 years in prison for the armed robberies of three banks and a credit union last year, according to the U.S. attorney’s office.

Joseph Richards, 47, of Manchester also was sentenced to five years of supervised release and ordered to pay more that $30,000 in restitution.

According to court documents, Richards pleaded guilty in January to robbing the following banks and credit unions:

— Norway Savings Bank in Freeport on Aug. 3, 2015 of $5,854.

— Franklin Savings Bank in Franklin, New Hampshire, on Aug. 14, 2015, of $13,240.

— University Credit Union in Portland on Sept. 4, 2015, of $12,380.

— TD Bank in Lewiston on Sept. 12, 2015, of $9,888.

More than $40,000 was stolen, but the money from the last robbery was recovered, according to federal prosecutors.

Richards was on supervised release at the time of the 2015 robberies for a 2002 bank robbery in New Hampshire. He was released from federal prison in March, according to information obtained from the U.S. Bureau of Prisons’ Inmate Locator website.

He was sentenced to 12½ years in prison for that crime in April 2003 in U.S. District Court in Concord, New Hampshire. Information about that crime was not available through the court’s electronic case filing system because the case is more than a decade old.

On Wednesday, Richards was sentenced to two years in prison for violating his supervised release in that prior case, according to the U.S. attorney’s office. He will serve that sentence at the same time he serves the 15 years for the recent armed robberies.

Joseph, who wore disguises during the 2015 crimes, planned and carried out the robberies with two co-conspirators, Neil West, Sr., 65, of Portland and Crystal L. Dufault, 33, of Manchester, New Hampshire, according to court documents. She pleaded guilty in January to armed bank robbery and conspiracy to commit bank robbery for taking part in the robberies in Franklin and Portland. Dufault is scheduled to be sentenced next month.

West, who was released in May 2015 after being sentenced to 41 months in prison for being an accessory after the fact to a robbery of a bank in Wells nearly four years ago, was convicted by a jury in July of armed bank robbery and conspiracy to commit robbery.

He drove the getaway car for the robberies in Freeport, Portland and Lewiston, according to court documents. West’s sentencing date has not been set.

The maximum sentence for armed bank robbery is 25 years in federal prison.