CHICAGO — The city’s teachers agreed Tuesday to return to the classroom after more than a week on the picket lines, ending a spiteful stalemate with Mayor Rahm Emanuel that put teacher evaluations and job security at the center of a national debate about the future of public education.

Union delegates voted overwhelmingly to formally suspend the strike after discussing details of a proposed contract settlement worked out over the weekend. Classes were to resume Wednesday. Delegates poured out of a South Side union hall singing “solidarity forever.”

“I’m very excited. I miss my students. I’m relieved because I think this contract was better than what they offered,” said America Olmedo, who teaches fourth- and fifth-grade bilingual classes. “They tried to take everything away.” Said Shay Porter, a teacher at the Henderson Academy elementary school: “We ignited the labor movement in Chicago.”

The walkout, the first in Chicago in 25 years, shut down the nation’s third-largest school district just days after 350,000 students had returned from summer vacation. Tens of thousands of parents were forced to find alternatives for idle children, including many whose neighborhoods have been wracked by gang violence in recent months.

Union President Karen Lewis said the union’s 700-plus delegates voted 98 percent to 2 percent to reopen the schools.

“We said that we couldn’t solve all the problems of the world with one contract,” Lewis said. “And it was time to end the strike.”

Tuesday’s vote was not on the contract offer itself, but on whether to continue the strike. The contract will now be submitted to a vote by the full membership of more than 25,000 teachers.

The walkout was the first for a major American city in at least six years. It drew national attention because it posed a high-profile test for teachers unions, which have seen their political influence threatened by a growing reform movement. Unions have pushed back against efforts to expand charter schools, bring in private companies to help with failing schools and link teacher evaluations to student test scores.

The strike carried political implications, too, raising the risk of a protracted labor battle in President Barack Obama’s hometown at the height of the fall campaign, with a prominent Democratic mayor and Obama’s former chief of staff squarely in the middle. Emanuel’s forceful demands for reform have angered the teachers.

The teachers walked out Sept. 10 after months of tense contract talks.