Police were called to the Meridian Tower in Swansea at 4pm after a man was taken hostage on the 28th floor by another man who was in possession of a firearm.
Specialist units were dispatched to the scene, including a force helicopter, armed response officers and a trained police negotiator. Road closures were put in place at the bottom of the tower and the public were advised to avoid the area.
After approximately two hours, a tactical response team fired a Taser to subdue the armed man and detain him.
South Wales Police said a handgun had been recovered from the scene and a local man was in custody at Swansea police station.
Nobody was seriously injured as a result of the incident.