WASHINGTON — Several blocks near the White House were shut down for most of Monday morning as an armed woman barricaded herself in an office building, adding to tensions in a city already at heightened alert after the terrorist attacks in Paris.

The woman was apprehended after a roughly 10-hour standoff that began with a call to the police at 12:19 a.m. Monday. The authorities said that the woman had threatened to harm herself and others, and that she had discharged a firearm after officers arrived at the building, on K Street Northwest.

A police spokesman said that the woman surrendered around 10:30 a.m. The police identified her as Sophia Dalke, 31, of Springfield, Va. The authorities declined to say how Ms. Dalke, who was charged with assault on a police officer while armed, came to be in the building or who reported her presence there.

Traffic in downtown Washington was snarled through the morning rush. Streets near the office building began to reopen shortly after 11:30 a.m., but only after thousands of people and cars had been prevented from entering the area, in the heart of Washington’s business district, for most of the morning.