Police said Diblasi had robbed a bank in Billerica and another in Tewksbury before he drove a red Ford Explorer up to the teller window of the Wilmington bank at 370 Main St., at the intersection with Middlesex Avenue.

Diblasi first approached a drive-up window at Lowell Five Bank in Billerica around 10:30 a.m. and passed the teller a threatening note demanding money, according to a release from Wilmington police. He left the bank with a sum of cash, the release said.

Less than an hour later, police said, he left a Tewksbury Lowell Five at 1775 Main St. with more cash, the amount again undisclosed.

But when Diblasi allegedly reached the Eastern Bank branch on Main Street, about 40 minutes later, a Wilmington police officer, Julie Pozzi, was waiting and watched his red SUV approach the drive-up window, according to police.

“The officer immediately drew [her] weapon and pointed it at the Explorer,” said Ian Anderson, 18, who was turning onto Middlesex Avenue when the scenario unfolded. “Three minutes later a bunch of cops pulled up.”

Officials and police did not comment on whether Diblasi was carrying a weapon or the charges he faces; an officer at the Wilmington Police Department said only that he will be charged with robbery. The Billerica, Tewksbury, and Wilmington police departments are all investigating.

Diblasi will be arraigned Friday in Woburn District Court, said Middlesex district attorney’s office spokeswoman MaryBeth Long.

Witnesses in Wilmington described a dramatic scene Thursday involving multiple officers, some with guns drawn, and a parking lot flooded with police cars. Employees of the nonprofit Wilmington Family Counseling Service watched the arrest take place through a window facing the bank.

Administrative assistant Laureen Karajeh said she saw a detective in a protective vest and an officer with a long gun, resembling a rifle. She said officers surrounded a man on the ground beside the red sport-utility vehicle. Both of the front doors were open, the man was lying motionless next to it.

“All we could see were his feet,” she said.

On a usually quiet street, said workers and business owners, the influx of emergency vehicles and news helicopters came as a surprise. In an area at the heart of a grocery-store-chain protest movement, some had differing ideas of what had caused the commotion.

“I thought it was Market Basket settling their dispute,” said Paula Wamness, an administrative assistant at the nonprofit.

The bank was closed for several hours following the attempted robbery, but reopened later in the afternoon.

“We are thankful that the Wilmington police were able to quickly resolve this situation, and we appreciate their efforts,” said Eastern Bank spokesman Andrew Ravens.

“It’s great to get another bad guy off the street.”

Jack Shaw, the owner of J.F. Shaw Inc. across the street, said that little usually happens in the area, so the attempted robbery was surprising. The towns where the robberies took place are each about a 15-minute drive apart.

“I guess people figure they could get away easy,” he said. “That’s kind of a strange way to rob a bank — through a drive-through window.”