CLAYTON, Mo. (AP) — Officials say a 20-year-old black man charged with shooting two police officers watching over a demonstration outside the Ferguson Police Department attended a protest there earlier that night but told investigators he wasn't targeting the officers.

St. Louis County Police Chief Jon Belmar takes questions/Getty Images

St. Louis County Prosecutor Robert McCulloch says Jeffrey Williams told authorities he was firing at someone with whom he was in a dispute, not at the police officers.

McCulloch says -- quote --"We're not sure we completely buy that part of it " and adds there might have been other people in the vehicle with Williams.

Williams is charged with two counts of first-degree assault, one count of firing a weapon from a vehicle and three counts of armed criminal action. McCulloch says the investigation is ongoing.

The officers were shot early Thursday as a crowd began to break up after a late-night demonstration that unfolded after Ferguson Police Chief Tom Jackson resigned in the wake of the scathing federal Justice Department report.

The officers were released from the hospital later Thursday.