Mr. Emanuel’s critics blamed him for failing to stem gun violence in the city’s neighborhoods, for closing nearly 50 schools during his first term, and for his administration’s monthslong delay in releasing a video that showed a white police officer shooting a black teenager, Laquan McDonald, on a Southwest Side street in 2014. The trial of the officer, Jason Van Dyke, was set to begin on Wednesday and was being closely watched in Chicago.

[Read more about the murder trial of Officer Van Dyke.]

The mayor’s alliances in the Loop’s gleaming downtown skyscrapers set up a clash with outlying neighborhoods on the city’s South and West Sides where schools were closed, and won him a nickname among critics: “Mayor 1 Percent.”

“He came in like a wrecking ball,” said Jesse Sharkey, the acting president of the Chicago Teachers Union, which had clashed with Mr. Emanuel and had held its first strike in a quarter century under his watch.

The Rev. Ira Acree, a West Side minister, cheered Mr. Emanuel’s planned departure from leadership as a victory for the city, calling it “a concession that he can’t defend his abysmal record of the tale of two cities and all of the problems he has failed to fix.”

Before he returned to Chicago to be mayor, Mr. Emanuel had been President Barack Obama’s chief of staff. Before that, he had served as a Democratic member of Congress and had advised an earlier president, Bill Clinton. On Tuesday, both former presidents issued statements of praise; Mr. Obama described Mr. Emanuel as “a tireless and brilliant public servant.” Mr. Clinton said he had “served with vision, purpose, principle and impact.”

Around the city, the mayor’s critics and political strategists speculated that Mr. Emanuel was stepping down because he feared that he could not win. Some said the fallout from the police-shooting trial, likely to play out for weeks at the courthouse, could not come at a worse time for the mayor, as the election season was gaining steam.

“It’d be a tough go for him no matter how that came out,” said Don Rose, who has worked as a political consultant.