The nation’s public schools, which collectively serve more than 50 million schoolchildren, are set to get about $54 billion in coronavirus aid, funding that will help them cover steeply escalating costs from paying for personal protective equipment, building renovations and for technology needed to educate children remotely.

But education advocates warn that the funding will not be enough to compensate for the deep and painful cuts schools are likely to endure as a weakened economy wreaks havoc on state and local budgets. State and local dollars provide the vast majority of funding for public schools. When state and local governments face shortfalls, schools are often the first to feel the pain. The funding represents about a quarter of what many advocates had hoped for, and includes no additional money for a program that expands Internet access.

“Any failure to provide any funding for state and local governments is going to impact our local school districts,” said Anna Maria Chávez, executive director of the National School Boards Association.

The bill President Trump signed into law Sunday provides about $900 billion worth of aid, including to extend unemployment benefits, maintain lifelines for foundering businesses, boost vaccine distribution and deliver $600 stimulus checks to American households, among other things.

State and local governments, which are already seeing a steep drop-off in tax revenue, received no funding from the latest relief package. Earlier this month, several big-city mayors and state governors sounded the alarm about the devastation the pandemic has wrought on their budgets, and warned they would have to raise taxes and lay off public-sector workers. School funding, which often accounts for the lion’s share of state and local budgets, will undoubtedly feel the pinch.

State lawmakers in Georgia cut nearly $1 billion in education funding over the summer, and state lawmakers in Nevada cut about a quarter of education funding in that state. School districts in California, Massachusetts, Idaho, Pennsylvania and Rhode Island laid off teachers earlier this year, according to an Education Week database.

Schools have been waiting for a funding boost for months. In the first coronavirus relief package, passed shortly after schools shut down in March, lawmakers allocated $13 billion for schools. They have not received any additional funding since.

The funding comes after months of deadlock over a coronavirus relief package.

Schools have, since the start of the pandemic, encountered many unanticipated costs. School closures forced them to put in mass orders for laptops and WiFi hotspots. In some cases, school districts were paying home Internet bills for families with students.

Reopening, too, has created a slew of new expenses, including for masks, face shields, desk shields, disinfectant and air filters. Many schools had to hire more teachers so fewer students would be crammed in to classrooms, or had to up their funding for substitutes so they would not have to close their doors when teachers fell ill or had to quarantine.

But the steepest costs are likely to come later, when more children return to classrooms. Schools are bracing for educating students who have lost months of learning, and have faced the trauma associated with homelessness, hunger and isolation. Many schools have seen far fewer students enroll for kindergarten and prekindergarten, and they fear that children missing out on early learning will not be able to keep up with their peers. And since funding formulas are based on student enrollment, fewer students in the classroom means less funding overall.

Pedro Martinez, the superintendent of San Antonio Independent School District, said the convergence of budget cuts and increased student needs creates a “perfect storm.” He said his district could face up to a $20 million budget cut because of a decline in enrollment. “We have to [cut] while we’re also trying to come up with additional resources for all the investments we have to make just to keep our children safe.”

Oklahoma offers prekindergarten in nearly all of its communities — but the number of students who took advantage of it dropped sharply this year. Joy Hofmeister (R), the state’s superintendent of public instruction, said she is concerned about how today’s missing prekindergarten and kindergarten students will fare in the years to come.

“That is going to have an effect in the years to come with shoring up reading foundations,” Hofmeister said, calling preschool “so critical to the foundation that everything else will be built upon in future years.”

The state has a long history of underfunding schools, leading to a statewide teacher walkout two years ago that pushed the legislature to make large investments in the state’s schools and in boosting salaries for teachers — which had been among the lowest in the country. Hofmeister said that if the state backtracks and begins cutting money for schools, the consequences could be disastrous.

“If we have one misstep, it will have a profound impact in the lives of kids in our state,” she said.