A 45-year-old man has been arrested on suspicion of breaching a restraining order following a siege in Cheltenham that lasted for more than nine hours.
A police spokesman said officers had gone to a flat to carry out an arrest, but a man doused himself in petrol and threatened to set himself alight.
Emergency services, including a police negotiator, were called to the scene at Evesham Road at about 0610 GMT.
The road was cordoned off and reopened earlier in the afternoon.
Several residents were led from the building during the incident. The local man was arrested just before 1545 GMT on Thursday.
Insp Steve Norris said: "The safety of the public, officers and the subject was our priority throughout. We deployed the correct resources to bring the incident to a safe conclusion."