Two men were arrested in Florida after they allegedly robbed two people at gunpoint outside an apartment building and took their cellphones — a move that ultimately helped track down the suspects, according to law enforcement officials.

The Hillsborough County Sheriff’s Office said 21-year-old Jamel Hernandez and 23-year-old Kareem Hernandez were arrested and charged with armed robbery with a firearm and armed burglary.

The sheriff’s office said the victims were sitting in a vehicle off Douglas Oaks Circle in Tampa just after 8 p.m. on Monday, when the alleged culprits approached and robbed them at gunpoint.

FLORIDA MAN ARRESTED AFTER ALLEGEDLY TRYING TO STEAL GENERATOR POWERING TRAFFIC LIGHT AFTER HURRICANE

overhead-camera

Law enforcement from Hillsborough County and Tampa, Fla., surround the vehicle two men accused of robbing two victims at gunpoint were occupying. (Hillsborough County Sheriffs Office)

The suspects fled the scene with the victims' phones.

One of the victims was able to track their phone, which helped lead deputies and members of the Tampa Police Department to the location of the suspect’s vehicle.

ABANDONED DOG LEFT TIED TO FENCE BEFORE HURRICANE MILTON NOW ‘SAFE AND SOUND’ WITH NEW NAME

suspect-detained

Two men were arrested after allegedly robbing two victims at gunpoint and fleeing with their cellphones. (Hillsborough County Sheriff's Office)

Video of the arrest was shot from above the scene and showed police vehicles surrounding the vehicle with the suspects inside.

Another clip from video taken from a police body camera shows police ordering the occupants of the vehicle out with their hands up until they were handcuffed and detained.

CLICK HERE TO GET THE FOX NEWS APP 

"These arrests are a prime example of how inter-agency teamwork can swiftly bring dangerous criminals to justice," Hillsborough County Sheriff Chad Chronister said. "We will continue to work tirelessly with our law enforcement partners to ensure that those who threaten the safety of Hillsborough County residents are taken off the streets."