The Chicago Teachers Union announced that it would begin a strike on Thursday.

Mayor Lori Lightfoot is paying the price for years of neglect under Mayor Rahm Emanuel and Mayor Richard Daley.

Teachers in Chicago announced Wednesday evening that they would go on strike, forcing the cancellation of classes for more than 300,000 public school students in the nation’s third-largest district starting Thursday.

The strike threatened to upend life in the city, as parents raced to make arrangements for child care and as city officials began to activate a contingency plan for supervising and feeding students in school buildings.

The strike in Chicago is the latest in a string of more than a dozen major walkouts by teachers across the country since early last year. It is an important early test for Mayor Lori Lightfoot, who was elected this year after a campaign in which she called for more nurses and social workers in the city’s schools — some of the very changes Chicago’s teachers are seeking now.

The city and the Chicago Teachers Union, which represents more than 20,000 educators, had been in tense contract negotiations for months, and there had been signs of progress in recent days. But as a midnight deadline approached on Wednesday with no deal, Ms. Lightfoot canceled Thursday classes and both sides signaled that a walkout was inevitable.

The split between the city and the union stretches beyond traditional debates over pay and benefits, though representatives for each side disputed details of what had been offered during negotiations and what the exact points of contention were now.

The city said that it has offered teachers pay raises totaling 16 percent over a five-year contract, while union leaders have called for increases of 15 percent over a shorter three-year term. More pressing, union leaders say, are their calls for a promise — in writing — of smaller class sizes, more paid time to prepare lessons and the hiring of more school nurses, social workers, librarians and counselors. Other issues, including affordable housing provisions and protections for immigrant students, have also been raised.

The strike is the first for Chicago’s school system since 2012, when teachers walked out for seven days as part of a defining battle with the city’s previous administration.

About 7,500 school support employees represented by a different union also rejected a contract offer and planned to go on strike Thursday. Those workers include security officers, bus aides, custodians and special education classroom assistants.