Mr. Emanuel, who angered some here when his administration closed nearly 50 public schools, clashed with public schoolteachers and oversaw the city through flashes of gang violence, received 45.4 percent of the vote, with almost 99 percent of precincts reporting, not the 50 percent plus one needed to win outright. His closest competitor was Jesus Garcia, a county commissioner known as Chuy, who had important backing from the Chicago Teachers Union. He got 33.9 percent of the vote, giving him a place in a runoff against Mr. Emanuel on April 7. The rest of the votes were split among three other candidates.

At a union hall here, a hoarse Mr. Emanuel pledged to press ahead.

“I want you to take a moment to celebrate what we have accomplished over the last four years,” Mr. Emanuel said. “Take stock in it and let us double down because tomorrow morning, I’ll be seeing you at the ‘L’ stops.”

He added, “We will get back out there, talking to our friends and families and neighbors, as they make a critical choice about who has the strength, who has the leadership, who has the ideas to move this great city forward so we can secure this great city for our children.”

Mr. Garcia, 58, portrayed the moment as a victory for ordinary Chicagoans.

“Today, we the people have spoken — not the people with the money and the power and the connections, not the giant corporations, the big-money special interests, the hedge funds and Hollywood celebrities who poured tens of millions of dollars into the mayor’s campaign,” Mr. Garcia told a crowd of supporters.