BANGOR, Maine — A Worcester, Mass., man wanted in connection with an armed bank robbery last month in suburban Boston was arrested Friday in Maine.

Craig Sparks, 28, was expected to be transferred to his home state after he appeared Friday afternoon before U.S. District Judge John Woodcock in federal court.

Sparks agreed to be returned to Massachusetts to face a charge of armed bank robbery with a dangerous weapon in U.S. District Court in Boston.

After Sparks’ court appearance, FBI agents based in Bangor declined to say when the defendant would be taken to Massachusetts.

Sparks and Benjamin Michaud, 32, address unknown, allegedly entered the Waltham, Mass., branch of the Bank of America about 12:30 p.m. Jan. 4 wearing ski masks, dark-colored hooded sweatshirts and latex gloves. Each man brandished what appeared to be a handgun and demanded money.

The two fled with about $10,676 in a stolen red Jeep Cherokee, according to court documents. The men left the Jeep a few blocks from the bank and got into a black Chrysler registered to Sparks’ mother that was under police surveillance.

How Sparks and Michaud knew each other was not explained in court documents, but both men were on probation for crimes committed in Massachusetts at the time of the bank robbery. Why investigators were watching the car before the robbery was not explained in the documents.

Police stopped Sparks and Michaud on Interstate 95 North in Lexington, Mass., which abuts Waltham, but the two escaped into a wooded area along the highway, the affidavit filed in federal court in Bangor stated. Shortly after 1 p.m. Jan. 4, Michaud was apprehended in a car being driven by an 80-year-old man when a Lex-ington police officer recognized him from a “be on the lookout” bulletin.

A white plastic bag containing about $9,284 with money bands from the bank was found on the floor of the passenger side of the car Michaud was in when he was arrested, according to court documents. Another $1,381 was found in the woods off the interstate. Police also recovered two black ski masks, a baseball cap and seven white latex gloves in Michaud’s pockets when he was apprehended.

The elderly man, whose name has not been released, told investigators that Michaud came to his back door and asked to use the phone. The driver told police that Michaud told him he had been in an accident but did not want the police involved, according to court documents. Where the man was driving Michaud was not ex-plained.

In the search of Sparks’ Chrysler abandoned on I-95, police found, among other items, two BB guns that looked like handguns. In the rear of the vehicle investigators found a brown jacket with a wallet, which contained identification for Craig Sparks.

The day after the robbery, the FBI in Boston issued an alert for a stolen 2007 Volvo with Massachusetts license plates that agents believed was connected to the bank robbery.

Details about Sparks’ arrest and whether a woman was with him were not immediately available. Local FBI agents referred questions about his capture to the Boston office. Officials there did not immediately return a phone call requesting information.

He was arrested Friday, according to court documents. Sparks spent part of the day at the Penobscot County Jail, where he was taken by FBI agents, according to jail personnel.

According to court documents, Sparks fled the Bay State with his girlfriend, who was not identified. She used a cell phone to call her parents in Massachusetts but told them she was with Sparks in Mississippi. Investigators might have been able to locate the pair from those telephone calls.

Court documents indicated a search warrant was obtained for a phone with an 857 area code. That area code is assigned to Boston, according to the Bangor area phone book published by FairPoint Communications.

Sparks, dressed in blue wind pants and a long-sleeved pullover red shirt, appeared calm in court Friday. He remained handcuffed and shackled throughout the proceeding but was able to sign documents.

Defendants in federal custody usually are brought into court with their hands cuffed behind them. The handcuffs most often are removed for the court proceeding and replaced after it has been completed.

If convicted, Sparks and Michaud each face up to 25 years in prison and a fine of up to $250,000.