Protesters smashed windows and splashed red paint on the District Attorney's Office in Salt Lake City on Thursday after prosecutors cleared police in the fatal shooting of a 22-year-old man, sparking a chaotic confrontation that left one officer injured and two demonstrators under arrest.

Late on Thursday, Utah Gov. Gary Herbert declared a state of emergency due to the unrest, restricting access to the State Capitol, while city officials pledged to push for changes to police policy to "dismantle systemic injustice."

"We accept there will be changes. What we don't accept is the violence and vandalism we're seeing tonight," said Salt Lake City Police Chief Mike Brown.

Protesters had gathered for weeks at the office of Salt Lake County District Attorney Sim Gill to demand a full investigation in the death of Bernardo Palacios-Carbajal, who was fatally shot while running away from police on May 23, and charges against the two officers involved.

Gill did release his report on Thursday, but he found that the officers were justified to fire 34 times at Palacios-Carbajal because he had repeatedly dropped and picked up a gun while fleeing police.

The decision was met with outrage from protesters and Palacios-Carbajal's family.

"I feel angry, sad, disgusted that my brother is gone and they think it's OK," Karina Palacios, his sister, said at a news conference. "The way they killed him is not right."

That anger boiled over at a protest that began when about 300 people gathered outside Gill's office with banners, megaphones and red paint. Chanting, "Justice for Bernardo" and "This is what democracy looks like," they painted the street red in front of Gill's office — an action the group also took last month to symbolize the "blood" on Gill's hands, protest leaders said.

The group then marched around downtown. At some point, protesters also slapped red paint on the district attorney's sign and painted anti-police graffiti. When protesters bashed out three windows with metal rods, police in riot gear moved in.

A tense standoff began between lines of armored police and protesters, some of whom threw bottles and other debris. A police helicopter circled over head, demanding over a loudspeaker that protesters disperse and warning at one point, "This is your last opportunity." Police used shields and batons on the crowd, video shows, until the demonstration broke up.

The Salt Lake City Police Department said that some officers were hit with pepper spray and one officer was taken to the hospital with unspecified injuries.

Police haven't released details about the two arrests, but a video posted to Facebook by Justice For Bernardo, a group behind the protests, shows protest leader Sofia Alcalá being handcuffed. Asked what she was being charged with, police said "destruction of property."

Protest leaders said demonstrators were injured by police and blamed officers for the conflict.

"We were peaceful, it was the riot police that literally charged at us and escalated the situation," said Jeanette Vega, an organizer with Justice for Bernardo. Vega accused police of firing non-lethal rounds at close range, saying, "Salt Lake City police care more about protecting buildings than human lives."

Palacios-Carbajal's case has galvanized protesters in Salt Lake City, particularly after bodycam footage was released showing officers firing dozens of times at him as he ran away. At the time, Salt Lake City Mayor Erin Mendenhall called the footage "genuinely disturbing and upsetting."

But Gill on Thursday laid out his finding that under state law the officers were justified in the killing. Police were called to a motel around 2 a.m. on May 23 after someone said two men had kicked in a door and robbed them at gunpoint. When police arrived, they found Palacios-Carbajal outside the motel; he ran away when they asked him to hold up his hands.

As he ran, he fell at least three times, dropping a gun each time and then picking it back up as officers yelled, "Drop it!" After the third time, officer Kevin Fortuna fired at him. He fell and rolled onto his back, holding the gun up toward the officers, Gill found, which led Fortuna and Officer Neil Iversen to fire dozens more times.

Gill found they had reason to fear for their safety and said video footage backed up their version of what happened.

Mendenhall said she supported the decision, adding in a statement that "evidence shows that our officers acted according to their training and the state law."

But the Salt Lake City Council said that while state law did appear to clear the officers, they would work to change standards to prevent similar cases in the future.

"We do not accept these systems as they are. We commit to doing our part to improve our City systems while advocating for changes outside our purview at the State or Federal level that will root out racism, dismantle systemic injustice, and lead the State of Utah in promoting equity and justice for all residents," the statement said.

Palacios-Carbajal's family, meanwhile, said they plan to sue the police department and pledged to work with protesters to fight for changes to the department's policies.