(CNN) The six-day Los Angeles teachers' strike ended Tuesday night after teachers and staff members threw their support behind a new agreement reached hours earlier, according to a preliminary vote tally.

The vote by members of the United Teachers Los Angeles union enables teachers to return to work on Wednesday, ending a battle that left 600,000 students in limbo.

Preliminary numbers from the vote show that "a vast super majority" voted yes, ending the strike, UTLA President Alex Caputo-Pearl told reporters late Tuesday.

He said the counting of the ballots will continue on Wednesday.

"It's a historic day today in Los Angeles," he said.

"Our members after a strike that began on Monday, January 14, are going to be heading back to school, to the students that they love and the classrooms that they love and the schools that they love and are committed to," he added.

The new agreement with the district includes a 6% raise, a gradual decrease in class sizes over the next few years and more counselors, librarians and nurses.

Union leaders and the Los Angeles Unified School District had struck a tentative deal around dawn Tuesday after a marathon 21-hour negotiating session, Mayor Eric Garcetti said.

"It is a historic agreement," the mayor, who helped mediate the dueling sides, said before Tuesday's vote. "It gets to lower class sizes. It gets to proper support staff."

.@LASchools today announced that it has reached an agreement with UTLA on a new contract that provides a 6% salary increase for educators, reduces class sizes, adds a significant number of librarians, counselors and nurses, and maintains the fiscal solvency of the school district pic.twitter.com/LKYM1QogMC — L.A. Unified (@LASchools) January 22, 2019

Caputo-Pearl praised the more than 30,000 teachers and staff members who picketed for six days, often under cold rain.

"I'm so proud of our members, classroom teachers, counselors, nurses, librarians, psychologists," Caputo-Pearl said earlier Tuesday.

He made those remarks at a news conference standing next to Beutner -- a symbolic sight, considering Beutner has been the target of intense UTLA criticism for months.

While both sides gathered in harmony Tuesday, "the strike was painful, and it had a cost," Garcetti said.

Thousands of teachers marched in the rain demanding more school staffing and higher salaries.

The first week of the strike cost the school district more than $125 million . That's because the state of California funds schools based on daily attendance, and the number of students going to school plunged during the strike.

Some parents said they purposefully kept their kids out of school in hopes that the money drain suffered by the district would lead to a resolution more quickly.

Why so many teachers toughed it out

For the past six school days, educators hit the picket lines to demand smaller class sizes, higher salaries and more school nurses and counselors.

"We work with students every day who face trauma and face hardship," Garfield High School teacher Erika Huerta said. "So we're doing this as a life passion to improve our community."

Teachers and students who joined them on the picket lines decried class sizes of 45 or more. They said many students aren't able to get the individual attention they need to effectively learn.

So the standoff between UTLA and LAUSD came down to two issues: how much money to spend on more school staffing and teachers' raises, and whether the school district actually has that kind of money.

The union wanted the school district to pony up more money to meet its demands, but LAUSD said its $1.8 billion in reserves is already earmarked for education spending during this three-year budget cycle.

The school district agreed that schools need smaller class sizes, more staffing and bigger raises for teachers.

"The issue has always been how do we pay for it," Beutner said. "We can't solve 40 years of underinvestment in public education in just one week, in just one contract."

Firefighters and celebrities join the fight

Firefighters marched Tuesday in support of Los Angeles teachers on strike.

During their week-long strike, teachers received support from a barrage of actors musicians and politicians

On Tuesday, they got a big boost from members of the International Association of Firefighters, who are in Los Angeles for a conference this week.

"We stand with LA teachers," read signs held by dozens of firefighters as they rallied during a parade Tuesday morning.

Some chanted "fighting for justice" as they rode atop a fire truck.