Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

CHARLESTON, W.Va. — West Virginia’s governor said Tuesday that teachers and educators will get a 5 percent pay raise, and that striking teachers will return to work on Thursday.

The deal came on the fourth day of a strike by West Virginia teachers, as thousands of people again descended on the state Capitol to protest poor wages.

"My commitment to education has been consistent from day one," Gov. Jim Justice said on Twitter. He said that all other state employees would get a 3 percent raise this year.

My commitment to education has been consistent from day one. We're giving all teachers a 5% raise and all other State employees 3% this year. — Governor Jim Justice (@WVGovernor) February 27, 2018

A teachers' group said on Facebook that "Schools are called off on Wednesday for a cooling off period and will resume on Thursday."

"The long and the short of it is, now we have concluded with at least as far as an agreement that we can possibly conclude, that our teachers will go back to work on Thursday," Justice said at a press conference. "Tomorrow, we'll use tomorrow as like a cooling off day because we’ve already got some schools that have been canceled."

On Tuesday a large crowd outside the state Senate chamber loudly chanted slogans — including "United we stand!" and "Where is justice?" — and waved homemade posters as a walkout that began last Thursday escalated.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We are fed up. Enough is enough," said Jamie Heflin, 38, a single mother who teaches at Lenore K-8 School in Williamson. "We're tired of the disrespect."

The four-day strike had left more than a quarter of a million students out of class in the 55 counties across the state, rattling some officials.

"Work stoppages by public employees are not lawful in West Virginia and will have a negative impact on student instruction and classroom time," West Virginia Superintendent of Schools Steven Paine said in a statement last week.

"I encourage our educators to advocate for the benefits they deserve, but to seek courses of action that have the least possible disruption for our students."

In 2016, the average salary for West Virginia teachers ranked 48th in the nation, according to data compiled by the National Education Association. The organizers of the protests have said many teachers are forced to take second jobs just to make ends meet.

"We can't be doing our jobs for less and less and less money," said Carmen Soltesz, 37, a middle school social studies teacher in Williamson who has been on the job for a decade.

John and Kerry Guerini of Fayetteville, West Virginia, hold signs at a rally at the state Capitol in Charleston, West Virginia on Feb. 26, 2018. John Raby / AP

The strike began a day after Justice signed legislation giving teachers and some other state employees a 4 percent raise over three years. They would receive a 2 percent raise starting in July, followed by a 1 percent increase in fiscal years 2020 and 2021, according to a news release.

That legislation has been sharply criticized by teachers' unions and their members, who say the pay increases are too stingy. The raises, they say, would not cover cost-of-living spikes and the rising cost of health care.

"The proposed raise ... doesn't even keep us up with other states," said Dale Lee, the president of the West Virginia Education Association."

Amid the strike, food banks have helped provide lunches to students who rely on school meals, according to local reports. And despite any inconveniences, Lee insisted the teachers had "community support."

"You see families dropping off water, food, pizzas," Lee said. "It's like that all over the state."

Justice credited a 6th-grader with helping to change his thinking on the issue. He said he was explaining tourist investment to the boy Monday and the child said, "Wouldn’t it be an investment to invest in smart teachers that would make me smart, and then I could, in turn, turn around and do smart good things for our state?"

"He’s right. And to be perfectly honest, in a lot of ways I was looking at this maybe not correctly,” Justice said. The governor said he "went home and I thought a lot about it."

Justice said he raised the revenue estimate for the state. He said that a task force would begin looking at the West Virginia Public Employees Insurance Agency, to "try to look for solutions that are a permanent fix" to the system.

Ron Allen reported from Charleston, and Daniel Arkin from New York.