A man found guilty of shooting and wounding two police officers who were at a protest in Ferguson, Mo., over the death of Michael Brown was sentenced to 25 years in prison on Friday.

Jeffrey Williams, 22, was convicted in December of first-degree assault for the shooting on March 12, 2015. The incident took place as demonstrators gathered at the Ferguson Police Department heard news that former Ferguson Police Chief Tom Jackson had resigned after a report describing racial bias and profiling in the St. Louis suburb.

Brown, 18, was shot and killed by Ferguson police officer Darren Wilson in August 2014. He was unarmed and witnesses said that he had surrendered to Wilson, although police have maintained that he attacked the officer, who said he feared for his life. A grand jury later decided not to indict him. He was also later cleared of federal charges as well.

Related: Michael Brown Shooting — New Film Reveals Possible Overlooked Evidence

The protesters were cheering Jackson’s resignation when shots rang out from a passing car, striking St. Louis County officer Scott Brown in the shoulder and Webster Groves, Mo., officer Cameron McKay in the cheek. Both survived, but McKay never returned to duty and left the Webster Grove department.

The sentence was given by St. Louis County Circuit Judge Gloria C. Reno, although the state wanted to hand Williams 30 years behind bars. His lawyer, Jerryl Christmas sought 15 years.

Williams has said that another man in the car fired the shots. But police said Williams confessed, and a pistol found at his home matched shell casings at the shooting scene.

In a recording of jail phone calls obtained in April 2015 by The Associated Press, Williams said he was shooting at someone else, not the officers.

“Nobody aiming at no police,” he says in the audio. “I ran up the hill and he (an unidentified person) shot at the car. … I shot back.”

Later in the conversation Williams said he knew he was likely headed to prison but guessed low on the length of his sentence.

“Even though I was in the wrong, though, I should have just went the other way,” he said. “Oh man, now I’m looking at 10 years.”

Christmas said Williams will likely appeal.

With reporting by AP