The union representing striking Los Angeles teachers reached a deal with the school district Tuesday to end the strike and increase teachers' pay and shrink their class sizes. Teachers will head back to school on Wednesday.

"This is a good agreement. This is a historic agreement," Los Angeles Mayor Eric Garcetti said.

The mayor does not have authority over the school district, but urged the two sides to negotiate after more than 30,000 public school teachers walked out of classrooms and hit picket lines for the first time in 30 years. The strike entered its ninth day on Tuesday.

Striking public school teachers and their supporters march during the 34th annual Kingdom Day Parade on Martin Luther King Jr Day, Jan. 21, 2019, in Los Angeles.(Robyn Beck/AFP/Getty Images, FILE) Striking public school teachers and their supporters march during the 34th annual Kingdom Day Parade on Martin Luther King Jr Day, Jan. 21, 2019, in Los Angeles.

In addition to those top-line changes, an increase in the number of support staff like counselors, nurses and librarians were also a factor in the deal, Alex Caputo-Pearl, the president of the United Teachers of Los Angeles said at a joint news conference.

Caputo-Pearl noted that preliminary numbers showed the agreement passing with a "vast super majority."

The exact details of the deal -- including the specifics of the pay increases and the decreasing class sizes -- were not discussed at the news conference but are expected to be confirmed after union members are informed. Garcetti did say that the reductions in class sizes would take place over time, and "every year for the next four years, they'll see reductions."

Caputo-Pearl said that the strike came after years of frustration.

"Educators and parents reached a boiling point ... about conditions in classrooms," he said.

Mayor of Los Angeles Eric Garcetti speaks at a press conference, Jan. 22, 2019.(KABC) Mayor of Los Angeles Eric Garcetti speaks at a press conference, Jan. 22, 2019.

Austin Beutner, the superintendent of the Los Angeles Unified School District, agreed that the frustrations had been building as a result of decades of budget issues.

"We can't fix 40 years of under-investment in a week," Beutner said at the joint news conference, but added that the tentative deal helps to build "a shared commitment to do even more."

"This is the start, not the end. This is the start," he said.

Earlier Tuesday, Garcetti's office said that the superintendent and union leaders met for a long weekend of marathon contract bargaining.

Garcetti's office said in the statement that the most recent talks lasted for 21 hours and ended shortly after 6 a.m., hours before the deal was announced, the Associated Press reported.

"The strike nobody wanted is now behind us," Beutner said at the joint news conference.