DALLAS (AP): At least two snipers opened fire on police officers during protests in Dallas on Thursday night, killing four officers and injuring seven others, police said.

Dallas Police Chief David Brown told reporters the snipers fired "ambush style" upon the officers. He said police had a suspect cornered and were negotiating with him. Brown said 11 officers were shot, three of them fatally. Police later tweeted that a fourth officer had died.

The gunfire broke out around 8:45 p.m. Thursday while hundreds of people were gathered to protest fatal police shootings this week in Baton Rouge, Louisiana, and suburban St. Paul, Minnesota.

The protesters had gathered after a Minnesota officer on Wednesday fatally shot Philando Castile while he was in a car with a woman and a child in a St. Paul suburb. The aftermath of the shooting was purportedly livestreamed in a widely shared Facebook video.

ALSO READ: Another BSP leader quits, accuses Mayawati of greed for money

A day earlier, Alton Sterling was shot in Louisiana after being pinned to the pavement by two white officers. That, too, was captured on a cellphone video.

Video footage from the scene showed that protesters were marching along a street in downtown, about half a mile from City Hall, when the shots erupted and the crowd scattered, seeking cover.

Texas Gov. Greg Abbott released a statement saying he has directed the Texas Department of Public Safety director to offer "whatever assistance the City of Dallas needs at this time."

"In times like this we must remember — and emphasize — the importance of uniting as Americans," Abbott said.

The search for the gunman stretched throughout downtown, an area of hotels, restaurants, businesses and some residential apartments. The scene was chaotic, with helicopters hovering overhead and officers with automatic rifles on the street corners.

"Everyone just started running," Devante Odom, 21, told The Dallas Morning News. "We lost touch with two of our friends just trying to get out of there."

Carlos Harris, who lives downtown told the newspaper that the shooters "were strategic. It was tap tap pause. Tap tap pause."

The gunshots in Dallas came amid protests nationwide over the recent police shootings.

In midtown Manhattan, protesters first gathered in Union Square Park where they chanted "The people united, never be divided!" and "What do we want? Justice. When do we want it? Now!"

A group of protesters then left the park and began marching up Fifth Avenue blocking traffic during the height of rush hour as police scrambled to keep up. Another group headed through Herald Square and Times Square where several arrests were reported.