The incident began at about 2.30pm when police became aware of a man in a distressed state in a flat at John Street, close to Craigavon Bridge.
Officers deployed to the scene and over a period of several hours were joined by emergency services 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 said they had concerns for the welfare of a resident of one of the flats and officers spoke to him by telephone.
It was reported that the man had told police that he had a grenade, although this was not confirmed by the PSNI.
Chief Inspector Tony Callaghan, the Foyle Area Commander, said: “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.