A robber who swiped a cell phone from an unsuspecting victim's pocket ended up in handcuffs this weekend, after police used the phone's GPS to find the thief.

The 22-year-old male victim was walking past a group of people at 4 a.m. on Saturday when the crime occurred, according to the San Francisco Police Department.

As the victim passed the crowd at Turk and Taylor Streets, a 22-year-old male suspect removed the cell phone from the victim's pocket "then walked away," police say.

Realizing what had just happened, the victim "followed [the suspect] for a few blocks," until the suspect turned on the victim and hit him several times in the face and head.

But though the suspect then fled the scene on foot, that was not the end of the tale. When the victim reported the crime, police were able to track the stolen phone via its GPS, and "found and apprehended" the suspect.

Related: Tenderloin Cell Phone Thief Uses Beer As Weapon