A police officer was shot after a three-hour stand-off in Barnsley town centre.
Officers were called to an address in Cutty Lane, Barnsley, at 10.30pm on Sunday and when police arrived they found a man with an air weapon.
A South Yorkshire Police spokesman said the weapon was fired several times while the man was being contained on School Street.
One officer was shot in the hand but suffered only a minor injury.
The spokesman added: “Negotiators were brought in to assist just after 1.30am yesterday morning and a man in his early 20s was arrested.”
Nobody else was injured in the incident.
The spokesman added: “The incident was contained quickly by police with no immediate risk to the public, but officers would like to thank local people for their patience and cooperation.”