Police officers used shields to protect members of the public after a man was seen wielding a crossbow and threatening people in a town centre.
Armed officers were sent to Peel Street in Barnsley at about 01:30 BST on Sunday, South Yorkshire Police said.
A 31-year-old man from the town was subsequently arrested on suspicion of public order affray.
The arrested man had since been detained under the Mental Health Act, police said.
Supt Paul McCurry described the incident as "serious and distressing".
"Unarmed officers on routine public order duty approached the man using their shields to protect members of the public," he said.
"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, Supt McCurry said.
"Due to the skills of officers at the scene, he was swiftly detained and brought to safety."
Officers responded "very quickly with limited protection to safely resolve the incident", he added.
No-one was injured during the incident, according to South Yorkshire Police.
Anyone with footage of the incident or with information which could help police is being asked to get in touch with the South Yorkshire force.