Updated

With unanimous votes, West Virginia legislators raised teacher pay by 5 percent to end the nine-day walkout.

Gov. Jim Justice and West Virginia's Republican leaders had tentatively agreed Tuesday to end the strike and bring 277,000 students back to school and 35,000 employees back to work.

Lawmakers will seek to cut state spending by $20 million, taking funds from general services and Medicaid, Senate Finance Committee Chairman Craig Blair said.

“We have reached a deal,” Justice tweeted. “I stood rock solid on the 5% Teacher pay raise and delivered. Not only this, but my staff and I made additional cuts which will give all State employees 5% as well. All the focus should have always been on fairness and getting the kids back in school.”

wv AP pic 3

Thousands of teachers and school personnel fill the Capitol rotunda in Charleston, W.V., on Monday, March 5, 2018. (AP)

The governor, union leaders and the House of Delegates had agreed last week to the 5 percent pay raise for teachers, who are among the lowest paid in the nation and haven't had a salary increase in four years. But the Senate refused to go along, approving a 4 percent increase.

However, even with the new tentative deal, it must be approved by lawmakers before the walkout can official end.

“We've been down this road before,” West Virginia Education Association President Dale Lee said. “The winners in this are the students of West Virginia and the educators across West Virginia who finally see a true investment in education.”

The union's spokeswoman, Kym Randolph, said that if lawmakers quickly pass the legislation as they said Tuesday they intend to, teachers could be back at work Wednesday. "We just need to see it in writing," she said.

Senate leaders said they're on board this time. Senate Majority Leader Ryan Ferns, R-Ohio, said talks with the governor's office lasted into early Tuesday identifying cuts everyone could agree to.

Justice said additional budget cuts by his staff will fund the raises. Blair said that if the governor's estimates of increased revenue estimates from Justice come to fruition, supplemental appropriations could take place.

"This is very positive," Tina Workman, a second-grade teacher from Midland Trail Elementary in Kanawha County who has been at the Capitol each day with other striking teachers, told the Associated Press. "We are surprised, but we aren't putting all of our eggs from the chickens in one basket. We want it signed, sealed and delivered. Because seven days ago we were told the same thing, and we're still here."

"Teachers are the backbone of the education system and deserve the resources needed to inspire the next generation. A top-tier education, in West Virginia and across America, requires top-tier talent—and that requires an investment in our teachers," said AFL-CIO President Richard Trumka in a statement to Fox News.

wv pic AP 5

Elizabeth Ferguson Hollifield, a teacher from Princeton W.Va., holds a sign as she walks to a teacher rally Monday, March 5, 2018, at the West Virginia Capitol in Charleston, W.Va. (AP)

West Virginia Sen. Joe Manchin, a Democrat, praised the efforts of everyone in a statement released to Fox News.

“This is great news for West Virginia students, educators and all state employees. I applaud the Governor, and Democratic and Republican legislators for coming to this solution," Manchin said. "This is a solid investment in West Virginia’s education system and all of the services our state employees provide which includes our law enforcement officers.”

A show of support by thousands of teachers and supporters on Monday didn't sway lawmakers in time to avoid a ninth day of cancelled classes for the school system's 277,000 students and 35,000 employees.

Ferns said late Monday after a House-Senate conference committee worked for a compromise that Senate Republicans were concerned more about how the raise is paid for than the exact amount.

wv AP pic 1

West Virginia Education Association President Dale Lee, left, and American Federation of Teachers' West Virginia chapter President Christine Campbell talk to reporters as an agreement was reached by a legislative conference committee for a 5 percent pay increase for striking teachers Tuesday, March 6, 2018, at the Capitol in Charleston, W.Va. (AP)

About 5,000 people entered the building on Monday, posing security concerns and forcing the Capitol to briefly close. It was reopened an hour later, and teachers vented their frustration over the lack of progress. Their strike, in one of the poorest states in the country, has disrupted lives across the state, forcing working parents to scramble for child care and putting children who rely on meals at school at risk of going hungry.

With 17.9 percent of West Virginians living below official poverty levels, teachers, bus drivers and other volunteers are collecting food for students who rely on free breakfasts and lunches. Teachers also are sharing stories of donating their time, money or food. At least two GoFundMe pages have been launched in support of the walkout.

"It does make you feel good because we are helping them," said Ann Osburn, a special education teacher at Buckhannon Academy. "I think we're reaching as many as we can."

"We feel like we're under attack constantly," Cody Thompson, a social studies and civics teacher at Elkins High School, said. "Eventually, whenever you're pushed into a corner, you've got to push back.”

The teacher walkout over pay and benefits began on Feb. 22 after the governor signed a 2 percent pay raise for next year. He reconsidered after an initial round of protests, and the House of Delegates later approved a 5 percent increase. The Senate's insistence on a 4 percent raise Saturday prompted the union to extend the strike.

The Associated Press contributed to this report.