A nine-day strike by West Virginia teachers ended on Tuesday with state officials approving a 5 percent pay raise for all state workers, giving a boost to some of the lowest-paid educators in the country.

The walkout across the Appalachian state left more than 277,000 students idle as their teachers flooded the state capitol in Charleston to protest. Some schools planned to reopen on Wednesday after the deal was reached.

“Our children have suffered enough. We have to return some normalcy to the education process,” Republican Governor Jim Justice said before signing the pay raise bill in a televised ceremony.

Teachers cheered in the halls of the state capitol after the pay deal was announced, a broadcast by the governor’s office showed. West Virginia ranked 46th among the 50 U.S. states for average teacher pay last year at $45,783, according to the National Education Association.

Craig Blair, chairman of the Senate’s Finance Committee, said he believed the pay raise was the biggest in state history. The Senate had initially sought a 4 percent raise, balking at a 5 percent hike approved by the House of Delegates.

“We’ve also done this without increasing any taxes at all,” he said in a livestreamed meeting with House negotiators to reconcile differences in the chambers’ bills. “Now, there’s going to be some pain.”

Blair said lawmakers would pay for the raise by cutting state spending by $20 million, taking funds from general services and Medicaid.

Randi Weingarten, head of the American Federation of Teachers, said by phone from West Virginia that the strike was indicative of the state’s long history of labor activism as a coal mining hub and of the planning that educators had done before walking out.

“When you are pushed to the brink, people will stand up and show up and they will fight for themselves and their families,” she said.

In Oklahoma, teachers are weighing a possible walkout over budget cuts that have led to four-day school weeks in the state and teachers’ average salaries trailing those in West Virginia.

Reporting by Gina Cherelus and Jonathan Allen in New York and Ian Simpson in Washington; Editing by Colleen Jenkins and Tom Brown