Man Tries To Rob A Taxi Cab Just As A Cop Pulls Up Behind

A taxi driver in Reading, Pennsylvania was robbed at gunpoint, but the masked thief didn't realize there was a cop right behind them.

Dramatic footage shows the moment a masked gunman attempted to rob a Pennsylvania cab driver.

It also shows a cop--who just so happened to be behind them--come to the rescue.

The terrifying footage was recorded Monday after driver Ralph Valletta started his shift with Reading Metro Taxi.

The video shows the masked man shove a gun into Valletta's face.

Watch: Store Clerk Grabs Gun From Robber, Then Chases Him with Hammer

"All hell broke loose," Valletta told 69 News. "The gun came out at my head. He was screaming at me. He had his hoodie pulled down and I couldn't see anything but his eyes."

The man allegedly demanded money and video shows Valletta handing over all his $11.

At that very moment, lights flash from behind. As luck would have it, a Berks County Sheriff's deputy was right behind the cab.

"I stood in the back to try and hear the conversation ahead of time so knew what I was getting myself into," Deputy Terry Ely said. "At that point, I heard the driver say, 'Just please don't shoot me.'" 

Ely sprang to action, pulling out his own gun and telling the suspect to get out of the car and onto the ground.

Watch: Wallet Thief Returns Cards With Note; Stop Splurging, Do Your Own Nails

Valletta was saved. He ran to the officer, hailing him as his lifesaver.

"He immediately stood up, ran over to me, gave me a hug and said, 'Thank you. You're a godsend,'" Ely said.

Police arrested 18-year-old Victor Martinez-Herrer, who's been charged with robbery, terroristic threats and simple assault, WFMZ reports.

He was booked into Berks County Jail on $100,000 bail.

Watch: 9-Year-Old Girl Scout Gets Counterfeit Money While Selling Cookies Outside