Douglas A. Kelley, 26, of the 1100 block of Lorlyn Circle, was arrested in Batavia Thursday morning.
Kelley was believed to be armed, so residents in certain areas were asked to stay in their homes and make sure doors and windows were locked Wednesday night.
It started when three men robbed the Elgin State Bank at 590 N. McClean Avenue about 5 p.m. Wednesday night.
Police surrounded the red, four-door getaway car and took one suspect into custody while the other two tried to run. Police caught one. But the other got away.
Police activated their reverse 911 system to warn residents to be on the lookout. When the search started, police stopped Metra trains in the area for several hours.
"There was an eyewitness who provided details of a vehicle of the suspects," said Sargeant Dan O'Shea, Elgin police. "They fled in a vehicle. Officers spotted the vehicle."
Police had help from dogs as well as a helicopter in their search.
Kelley has also been charged with robbing Subway sandwich shops in North Aurora and Batavia.