The incident began at about 2.30pm and was finally resolved tonight at about 8pm.
The incident started when police became aware of a man in a distressed state in a flat in Derry’s John Street, which is close to Craigavon Bridge.
Officers from the PSNI’s Armed Response Team were deployed to the scene and over a period of several hours were joined by emergency services colleagues from the fire and ambulance services.
People living in the flats and in other nearby properties were moved from their homes and alternative accommodation was provided by Derry City Council.
Police had concerns for the welfare of a resident of one of the flats and officers spoke to him by telephone.
Chief Inspector Tony Callaghan, the Foyle Area Commander, told Derry Daily, “This was a fluid and very delicate situation.
“We had concerns for the man involved and our priority was to take every step possible to ensure that no harm came to the individual, or to anyone else in the proximity.
“I am very pleased that the situation has been resolved without harm to anyone.
“I want to pay tribute to all of the police officers and members of the other emergency services who were involved in the operation.
“It was not an easy one, but their professionalism and training were key elements in producing the outcome that we saw tonight.
“I also want to thank people in the community, their leaders, the city council and health and social care professionals for the support they have given us.
“I appreciate the patience of all concerned, not least the residents of the area and the general public, and, despite the length of the operation, I hope they understand the police service is focused on keeping people safe.”