Mr. Emanuel, who declined to be interviewed for this article, surprised many in Chicago when he called a news conference with less than an hour’s notice on Tuesday morning and said he would not seek another term. He did not explicitly mention the McDonald case, and Adam Collins, a spokesman for the mayor, said the trial was not a factor in the decision.

At the same time, only a few miles from City Hall, Officer Van Dyke’s final pretrial hearing was underway at the county courthouse. During a break, a sheriff’s deputy casually informed lawyers and courtroom spectators of the mayor’s announcement; some reporters scrambled to leave to cover the story.

A large field of challengers had already lined up to run against Mr. Emanuel, and many had made gun violence, policing and the McDonald case central to their campaigns.

Much of the anger with Mr. Emanuel is focused on the 13-month period between Laquan’s 2014 death, which attracted little immediate news coverage, and the court-ordered release of the dash camera video in late 2015. In those months, Mr. Emanuel was elected to a second term as mayor and the Chicago City Council approved a $5 million settlement with the McDonald family. Even then, Chicago officials refused to release the video, saying it was part of a criminal investigation, until a judge ordered that it be made public over the city’s objections.

As the images of Laquan crumpling to the ground set off marches through Chicago’s downtown, protesters accused the mayor of keeping the video under wraps to help in a difficult re-election fight. “Sixteen shots and a cover-up” became a rallying cry.

“Rahm Emanuel’s will was forced,” said the Rev. Ira Acree, a critic of the mayor who leads a West Side church and who said trust in the police continues to recede.

Amid the protests, Mr. Emanuel pledged to equip all patrol officers with Tasers and body cameras, and he spoke in frank terms about inequity and distrust in the police.