LONDON—Police in Northern Ireland said a woman was killed Thursday during a night of unrest in the city of Londonderry in which gasoline bombs were thrown and shots fired.

Mark Hamilton, an assistant chief constable, said police considered the killing to be a “terrorist incident” and had begun a homicide investigation. The victim, 29, was not immediately identified.

A local journalist, Leona O’Neill, wrote on Twitter that she was standing beside the woman when she fell beside a police vehicle. She said police immediately put the woman in the back of their vehicle and took her to a hospital.

In her Twitter feed, O’Neill described people throwing gasoline bombs, bricks and bottles at police in the Creggan area of the city. Videos showed vehicles on fire.

She said people had gathered in the streets after a large number of police officers had begun to search a home in the area.

After violence erupted, police appealed for calm.

The killing happened after Speaker Nancy Pelosi visited the city that same day to show support for the peace agreement that the United States helped broker two decades ago. She said it was vital to keep a “seamless border” between the Irish Republic and the British-governed Northern Ireland after Britain exits the European Union.

The Irish nationalist Sinn Fein and the pro-British Democratic Unionist Party condemned the killing. Sinn Fein called it an “attack on all the community.”