SAN LEANDRO (CBS SF) — Four teenage boys have been arrested for allegedly staging several armed robberies of ATM users across the Bay Area over the last two months, authorities announced Friday.

San Leandro detectives said the armed robbery spree began in early January in downtown Oakland. By the end of the month, the suspects were believed to have committed 19 robberies, four of them in the city of San Leandro.

READ MORE: Bicyclist Killed In Fall At Oakland's Shepherd Canyon Park

The four suspects — males aged 16 and 17 — were cooperating with the investigation and have confessed to many of the robberies.

Early this week, detectives began exploring a small piece of evidence that evolved into several leads. They began investigating addresses which eventually led to the discovery of a vehicle used in several of the crimes.

On Wednesday evening, a team of detectives and patrol officers, including a K-9 unit and aerial support from an outside agency began a large scale surveillance operation on the suspect vehicle.

Detectives followed as four suspects drove in the vehicle to communities in East Contra Costa County. The suspects at one point drove into a neighborhood and stole a license plate off of a parked vehicle and affixed that stolen plate to their vehicle.

The suspects then drove to several banks and began casing ATM machines. All the while police detectives were within distance to intervene and arrest if any of the suspects exited their vehicle.

READ MORE: Sabrina Spellman Makes An Appearance On The CW's Riverdale; Kiernan Shipka Reveals 'Fans Will Get Some Clarity'

The suspects continued for hours casing several banks in East Contra Costa County before returning to Alameda County. The suspects then cased banks in Livermore and Dublin and eventually returned to the East Bay.

By 10:30 p.m., the suspects had returned to San Leandro without committing any new robberies and stopped at a gas station at the intersection of San Leandro Blvd and Davis Street.

With several detectives in the area, a team of officers converged on the suspect vehicle with the intent to arrest the suspects for their crimes.

As police approached the vehicle, one of the passengers exited the vehicle and began to run. Officers gave chase as the suspect produced a handgun from his clothing and discarded the weapon in the street. Officers were able to reach the fleeing suspect and detain him without further incident.

A second suspect in the vehicle attempted to fight with police, however, was eventually detained with little force. The driver of the vehicle was detained without incident and a second firearm was found in the vehicle.

A fourth suspect, who had been riding in the vehicle earlier in the evening was later arrested at his home in Hayward.

MORE NEWS: Christmas Tree At Oakland's Jack London Square Catches Fire; Arson Investigation Underway

“Our team conducted a phenomenal investigation, looking at every piece of evidence for the smallest lead,” said San Leandro Police Lieutenant Isaac Benabou in a press release. “These are violent crimes with the potential of someone getting very seriously hurt or killed. We were shocked to find that these crimes were orchestrated by juveniles.”