An alert bystander called 911 on Friday after seeing two people wearing masks go into a Rancho San Diego cellphone store, allowing deputies to arrive in time to catch the masked gunmen — who turned out to be teenage boys — and arrest them as they tried to flee, sheriff’s officials said.

The robbery happened around 6:20 p.m. at the Verizon store in the Rancho San Diego Towne Center on Jamacha Road east of Campo Road, sheriff’s Sgt. Michael Hettinger said.

Deputies said the suspects were 17 and 16 years old.

“A citizen in the parking lot saw the two (teens) wearing masks as they entered the store and immediately called 911 believing the store was being robbed,” Hettinger said in a statement.

The 911 caller was correct, according to the sergeant.

“As soon as the (teens) entered the store, one of them pointed a firearm at the four employees in the store,” Hettinger said. “They demanded the employees give them the cash from the register and forced them at gunpoint into the back storeroom.”

Along with taking cash from the register and from employees’ wallets, the teens also forced the workers to open a safe containing “a large stock of phones,” and ordered them to load the phones into bags the suspects brought with them, Hettinger said.

But a built-in delay system in the safe forced the bandits to wait for the phones, apparently giving deputies time to respond to the shopping center.

“Rancho San Diego deputies... set up a perimeter around the store (and) as the rear-perimeter deputies set up, the two suspects attempted to leave out the backdoor of the store,” Hettinger said. “Upon hearing (deputies’) commands to surrender, they ran back inside the store and attempted to exit through the front door of the business. The suspects were met by the front-perimeter deputies and were taken into custody without injury.”

Inside the store, investigators discovered the phone and a gun, and one of the suspects was allegedly arrested while in possession of “a large amount of money” that was believed to have been taken during the robbery, the sergeant said.

No Verizon employees were physically harmed, according to Hettinger. Investigators did not locate any other suspects or a vehicle belonging to the teens.

Detectives from the Sheriff’s Department’s Rancho San Diego substation were continuing their investigation Friday night.