Updated at 2:30 p.m. ET

After more than a week of shuttered classrooms, the teacher strike in West Virginia is set to come to an end.

The state's governor and teachers union announced Tuesday they had reached a deal to implement a 5 percent raise for state employees across the board. And a little later in the day, lawmakers passed the measure with a unanimous vote.

Gov. Jim Justice is expected to quickly sign the deal.

Both Justice and the West Virginia Education Association celebrated the agreement even before members of the state's House and Senate convened a conference committee to discuss it.

"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," Justice tweeted. "All the focus should have always been on fairness and getting the kids back in school."

"WE WON!" the union exclaimed just minutes later in a tweet of its own, and it posted a Facebook video of teachers erupting in cheers in the Capitol. The demonstrators gathered there shouted chants of "Sign it! Sign it!" as Justice waded into the crowd.

"There's no question they're going to sign it. I'm going to sign it!" he told them. "Everybody here needs to know, from the absolute get-go, I am an educator. I believe in your purpose. I believe in you, and I love our kids."

The legislative path to that moment was far from smooth.

As NPR's Amy Held noted Sunday, GOP lawmakers in the state Senate had defied their fellow party members in the governor's mansion and the House — who both agreed to a 5 percent raise — and insisted on 4 percent raise instead.

Dave Mistich of West Virginia Public Broadcasting reports the senators had been skeptical of the salary hikes "after Justice's office announced last week that he had increased revenue estimates for the upcoming fiscal year by $58 million."

The Republican majority in the state Senate did not want to use any of that revenue toward the raises — and it appears they still won't. Senate Finance Chairman Craig Blair announced after the conference committee hearing that lawmakers will be funding the raises through "very deep" cuts to the state's budget, including entitlement programs and tourism, according to the West Virginia Gazette-Mail.

"There's going to be some pain," Blair said, as the local paper reports.

The Senate ended up passing the measure 34-0.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.