South Yorkshire Police were called in the early hours of this morning (Sunday) over a man in the town centre seen carrying the weapon.
Officers located a man on CCTV who was threatening bystanders on Peel Street in the town and an armed response was immediately dispatched to the scene.
Superintendent Paul McCurry, from the force, said: “Prior to their arrival, unarmed officers on routine public order duty approached the man using their shields to protect members of the public.
“Their actions resulted in the man dropping the weapon, which was safely recovered.
“The man then ran from officers, climbing onto the bridge on West Way. Due to the skills of officers at the scene, he was swiftly detained and brought to safety.”
A 31-year old man from Barnsley was arrested on suspicion of Section 3 Public Order Act Affray and remained in police custody on Sunday morning.
Police confirmed that no-one was injured during the incident.
Supt McCurry continued: “This was a serious incident which was distressing for those who saw it unfold.
“Our officers showed their absolute commitment to public safety this morning, they responded very quickly with limited protection to safely resolve the incident."
Anyone with information, images or footage of the incident is asked to contact the force on 101.