MOUNT OLIVE -- Mount Olive police caught a man just after he allegedly robbed the Wells Fargo bank with a BB gun Wednesday around noon.

Gary Ray Peebles, 56, of Clinton, Maryland, is charged with robbery with a dangerous weapon.

Mount Olive Police Chief Tommy Brown said the incident happened at about 12:05 p.m.

Peebles allegedly walked into the bank, indicated he had a gun -- which turned out to be a BB gun -- and demanded $4,000 from the bank.

Brown said Peebles kept the BB gun in his jacket pocket during the robbery.

A bank employee called 911, and law enforcement caught Peebles before he left the property.

"He made his way out of the door, and then law enforcement got there and was able to take him into custody without further incident," Brown said.

Brown said Peebles received an undisclosed amount of cash before being caught by officers. The cash was given directly back to the bank.

Peebles had apparently been to the bank earlier in the day trying to withdraw money from his account, but presented an invalid form of identification.

Brown said the bank told him he needed to return with a valid identification, and when he returned later in the day he allegedly robbed the bank instead.

Brown said the BB gun was not pointed at any of the employees, and only one customer was inside the bank at the time of the robbery.

Nobody was injured during the robbery.

The bank shut down for the remainder of the day, but is expected to reopen Thursday.

Peebles received a $200,000 secured bond on the charge.