RALEIGH, N.C. (WNCN) — The Wake County Sheriff’s Office arrested an armed man after deputies say he and two others tried to shoplift at a Raleigh Walmart Sunday.

According to a news release, an off-duty deputy was working at the Walmart Supercenter on New Hope Church Road at about 1 p.m. when loss prevention staffer told him that three people were taken to the store’s office on suspicion of stealing merchandise.

When the deputy arrived at the office, he said the trio had fanny packs and seemed nervous.

He said he had reason to believe the bags contained merchandise or weapons, according to the news release.

While he was searching the men, two of them fled from the store, according to a release.

After a brief foot chase, the deputy said Justin Collins, 22, of Maryland, was taken into custody.

The deputy says he found a gun belonging to Collins in the fanny pack, along with a second gun belonging to one of the others who fled, the news release said.

“The deputy’s quick action may have prevented a potentially dangerous situation for Walmart employees and customers,” said Wake County Sheriff Gerald Baker. “This incident is a perfect example why the Wake County Sheriff’s Office continues to provide important tools and training for our deputies to ensure they are always prepared to handle any potentially dangerous call.”

Collins was booked into the Wake County Detention Center.

He is charged with larceny, carrying a concealed weapon and resist, obstruct and delay, the news release said.

There is no word on the progress of the search for the other two suspects.