FAIRFAX COUNTY, Va. (DC News Now) — The man whom police said had a rifle on the balcony of an apartment building as he shouted threats Tuesday afternoon was in custody several hours after the situation started.

Officers were in the 3300 block of Rio Dr., at the Barcroft Hills Condominiums, where they negotiated with the man as of 6 p.m.

A tweet from the Fairfax County Police Department (FCPD) around that time said that the man had gone into the apartment. Police asked everyone to avoid the area, and they asked people within the apartment complex to follow the direction of the officers.

Police said they believed he was alone in the apartment, but they still were telling those “inside apartments at 6147 Leesburg Pike & 3245 Rio Dr to remain sheltered in place as negotiators continue to work toward a peaceful resolution.”

Shortly after 12 a.m. on Wednesday, the department tweeted that officers had taken the man into custody safely and that people were being allowed back into the building.