CHICAGO — 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, although there had been signs of progress in recent days.