Authorities respond to a barricade situation Wednesday in Rockville. The man surrendered to police, bringing a peaceful end to the incident. (Dan Morse/The Washington Post)

Police in Rockville were preparing to charge a 47-year-old man Wednesday night who earlier in the day had prompted SWAT teams to converge in a residential neighborhood just as residents were starting their morning.

The man was expected to be charged with assault and false imprisonment. No one was injured in the incident.

Just before 6:30 a.m., a woman told police that a man she knew was inside her apartment with a gun, police said.

The two had had a disagreement, the woman felt threatened, and she left the apartment, said Maj. Bob Rappoport of the Rockville police.

More than 50 police officers responded to the scene, in the 600 block of Azalea Drive. For at least two hours, they couldn’t make contact with the man. Officers eventually began speaking with the man, police said.

At 9:25 a.m., he came to a door and turned himself over to police. Police did not name the man because he had not been charged.

“The subject surrendered without incident,” Rappoport said.

Detectives found a .22-caliber handgun at the scene. Detectives were trying to learn more details about what precipitated the incident. The man lives in the neighborhood.

Rockville Police Maj. Tim Marsh said the SWAT teams were called in to ensure the safety of the man, the woman, the police officers and the neighborhood, where early in the morning people were walking their dogs, getting ready for work and trying to get their kids off to school.