MADISON — A Madison man accused of pointing a gun at a bank teller in Plain and escaping with $63,000 pleaded guilty Friday to federal charges of armed bank robbery and brandishing a firearm.

James Thompson, 29, faces up to life in prison, a $250,000 fine and seven years of supervised release when he is sentenced Dec. 5 by U.S. District Judge William Conley. Julian Thomas, also of Madison, is scheduled for a Oct. 16 trial on bank robbery charges related to the incident, said his attorney, Kelly Welsh.

In court Friday, Thompson said he and Thomas were driven to Plain on Oct. 7, 2014, and entered the People’s Community Bank.

Inside, Thompson said he “kept the gun on the tellers to keep them still,” while Thomas ordered the bank manager to enter the vault and remove the money.

A bank teller told authorities that after two masked men dressed in black entered the bank, the man with the gun poked her in the back of head when she did not open a teller drawer as fast as instructed, said Assistant U.S. Attorney Daniel Graber.

After the second robber returned from the vault, all the employees were pepper sprayed to immobilize them, Graber said.

Beth Manbauman, of Madison, told authorities she bought heroin from Thomas a few times in 2014 and drove him around Madison at his request.

Thomas had been looking for a woman who could serve as an inconspicuous driver for a small-town bank robbery, according court documents.

On the day of the robbery, Manbauman picked up Thomas and Thompson and drove them to Plain, where she thought they were delivering heroin or getting paid for a prior delivery, Graber said.

Manbauman said she would be paid in heroin for driving them, according to Graber.

On Thomas’ instruction, Manbauman parked her Nissan Quest near a car wash and Thomas and Thompson exited the minivan. They returned about 25 minutes later with one man carrying a “big bag of money.” Manbauman was told to leave quickly, Graber said.

According to court documents, law enforcement located Manbauman in May 2015 and she told them what Thomas and Thompson did on the day of the bank robbery.

Thompson and Thomas were in state custody on other offenses when they were indicted in federal court in May for the bank robbery.

Thompson was scheduled to go to trial until he signed a plea agreement last week. The agreement calls for Thompson to “cooperate” with authorities and give a complete statement of the offense.

Thomas previously had asked the court for a trial date separate from Thompson. However, court documents show the request was denied to prevent traumatized bank employees from having to testify twice.