Peter John Carr (42) escaped from custody at the Dunedin District Court on Thursday and members of the the public were warned he was dangerous and should not be approached.
Senior Sergeant Ed Baker, of Dunedin, said police were called by a customer at The Warehouse in Hillside Rd about lunchtime on Saturday and told Carr was in the building.
Police surrounded the exits and awaited the arrival of the armed offenders squad.
However, Carr spotted police when he tried to leave the store and ran through a rear exit into Hillside Rd.
He was chased by police into Hell's Pizza, where he was cornered in the kitchen, pepper-sprayed, arrested and charged with escaping custody, Snr Sgt Baker said.
"It was a concern when he got into the kitchen. There's sharp utensils in there and he's a volatile man.
"He resisted arrest. Police presented a Tazer but opted to pepper-spray him instead."
Carr had been arrested on Thursday afternoon on charges of misusing a telephone and another charge of sending a written threat.
Judge Paul Kellar refused to grant him bail and remanded him in custody to April 15, but Carr escaped about 4.40pm.
Snr Sgt Baker said how Carr escaped from the courthouse was being investigated.
It was not known where Carr had been hiding between Thursday and Saturday or if he was helped by a member of the public.
Snr Sgt Baker thanked members of the public for alerting police and helping to spot Carr when he ran from The Warehouse.
"We're pleased he's back in police custody. He was a danger to the public."