Chicago teachers will return to class on Friday after reaching a labor contract deal Thursday with the nation's third-largest school district.

More than 300,000 students had 11 unscheduled days off demanded better resources, smaller class sizes and a 15 percent raise for teachers over three years. The Chicago Teacher's Union’s 25,000 members had said the strike was based on a “social justice” agenda.

The walkout was the first major collective action by city educators since 2012 and was the longest-lasting strike in the city since 1987. It was one of the most significant tests to date for Chicago’s progressive Mayor Lori Lightfoot, who ran on a platform of investing in schools to bring them more nurses, librarians and social workers.

Union delegates voted late Wednesday to approve a tentative deal that includes pay raises over a five-year contract, but initially refused to end the strike unless the mayor added school days to cover lost time. Lightfoot agreed to make up five of the 11 days.

NEW CHALLENGE TO UNION POWER IN FACE OF JANUS RULING

The agreement stipulates a 16 percent raise for teachers over the life of the contract, a new committee to enforce smaller classroom sizes and $35 million per year to address overcrowding situations on a case-by-case basis, according to the Chicago Sun-Times. The agreement also provides funding to add social workers and nurses to city's schools.

Lightfoot said at the start of the strike that she would not restore any lost days and stuck to that position late Wednesday in response to the union's demands. Lightfoot and CTU President Jesse Sharkey met privately at City Hall on Thursday as teachers protested outside in the snow. The mayor eventually emerged from her office and announced the strike would end.

“I think about all those young people whose lives have been dramatically affected," Lightfoot said. "I think about the seniors. This is going to be the primary memory of their high school experience and I want to ... repair the damage that's been done."

REBECCA FRIEDRICKS: CHICAGO UNIONS STAGE A FAKE CRISIS TO GRAB POWER

Sharkey pointedly did not stand beside Lightfoot as she announced the end of the strike, telling reporters that union members “don't need to see me smiling with the mayor."

"What they need to see if that we have a tentative agreement and we now have a return to work agreement," he said. "I'm glad that people get to return to work. Frankly, it's been hard on teachers to be out this long and it's been hard on parents to be out this long. It's been hard on our students."

Throughout the strike, Chicago Public Schools kept school buildings open so that kids would have a safe place to go and receive meals. City parks, libraries and community groups agreed to take in children whose parents weren’t comfortable dropping them off at the schools.

CLICK HERE TO GET THE FOX NEWS APP

Several Democratic presidential candidates expressed their support for the union and its strike. Sen. Elizabeth Warren, D-Mass., and Sen. Bernie Sanders, I-Vt., both attended teacher rallies, Sen. Corey Booker, D-N.J., met with union members and former Vice President Joe Biden and others expressed encouragement on Twitter.

The Associated Press contributed to this report.