Classes are canceled for hundreds of thousands of students in Arizona and Colorado as educators descend on state capitols to rally for more education funding, part of a wave of teacher activism that has swept through West Virginia, Kentucky and Oklahoma.

In Phoenix, police estimated about 30,000 people converged on the statehouse for a demonstration that shut down schools in 102 districts statewide, according to the Arizona Republic. Many of them wore red T-shirts. That has become the movement’s signature color after an early demonstration called on teachers to wear “Red4Ed.”

Demonstrations also began in Denver, with hundreds of teachers showing up to demand more education funding and to protest changes to the teacher retirement system, KDVR-TV reported. More are expected Friday, when 20 districts announced they would close schools in anticipation for mass absences, according to the education news website Chalkbeat.

All told, the closures in both states mean more than a million students are scheduled to miss school this week because of teacher demonstrations, some of the largest to date.

The walkouts in the two states mirror earlier activism as educators, parents and the business community campaign to reverse years of cuts that have left teachers without raises, schools in disrepair and classrooms bereft of up-to-date textbooks and modern technology. The school funding reductions in the GOP-led states are a byproduct of generous tax cuts and, in some states, a slump in oil prices that slowed the economy and bruised state revenues.

Earlier protests proved successful, led by teachers in West Virginia who won a 5 percent raise after a tense nine-day walkout that ended in March.

Oklahoma lawmakers, facing the threat of a walkout, gave teachers a raise and agreed to an additional $51 million in school funding, funded by a hike in taxes on oil companies. But teachers still walked out — with many of them shutting down classes for two weeks. Their raucous presence in Oklahoma City may have nudged lawmakers to pass two bills raising revenues, ensuring the state would deliver on its promise.

Lily Eskelsen García, president of the National Education Association, said the walkouts are the culmination of years of frustration from educators, who have seen class sizes rise as their salaries remained stagnant.

“They have got so little to lose that this is the option they’re choosing rather than be silent,” the union leader said.

When adjusted for inflation, Arizona cut total state per-pupil funding by 37 percent between 2008 and 2015, more than any other state. That has led to relatively low teacher salaries, crumbling school buildings and the elimination of free full-day kindergarten in some districts. In 2016, Arizona ranked 43rd in average teacher salaries, according to a study by the National Education Association. The state reduced its education budget after the recession, and corporate tax cuts dealt a massive blow to revenue.

Low teacher pay has contributed to teacher shortages in Arizona. Some districts, unable to find qualified teaching candidates, have turned to emergency long-term substitutes, who are required to hold only a high school diploma.

The Colorado Education Association, a major union, said teacher salaries in that state have fallen when adjusted for inflation. Teachers made an average of $46,155 in 2016, according to the National Education Association, putting them at 47th in the nation. The stagnant salaries, combined with skyrocketing housing prices in the booming state, have made life untenable for many educators. The state’s constitution gives only voters the authority to raise taxes, and they have twice rejected such proposals.

“Too many educators can’t afford to live in the communities where they teach,” the teachers union said in a statement. “During the same timeframe, corporations in Colorado have received over $1.6 billion in tax breaks, while every year, educators are asked to do more with less.”

Even before the walkouts, lawmakers in both states had announced plans for greater investments in education. Arizona Gov. Doug Ducey (R) had pledged to give teachers a 20 percent raise by 2020, a promise that has yet to be borne out by legislation. Colorado lawmakers planned to invest an additional $425 million for the coming school year.

But educators in both states say that is not enough. In Arizona, teachers are also clamoring for the state to restore education funding to pre-recession levels. Colorado teachers say the $425 million is not enough to make up for all the lost ground following years of cuts.

“We don’t want to take this action, but it seems like this could be the only action that would bring about this change,” said Noah Karvelis, an elementary school music teacher in Phoenix. Karvelis, 23, co-created the Facebook group Arizona Educators United, which has become one of the driving forces behind the walkout. “Educator pay is a piece of it. But it’s really about funding education.”