After an outcry from educators, the U.S. Agriculture Department is extending a school meal program that has provided free meals to millions of children since the coronavirus pandemic shuttered schools in the spring.

The program allows families to pick up free food from any convenient school campus, regardless of whether their child is enrolled there and even if they do not qualify for free and ­reduced-price meals. It’s a form of meal delivery typically offered only during the summer months. But due to the pandemic, the Agriculture Department — which oversees the nation’s school lunch program — launched the program ahead of schedule in March and has kept it running ever since.

Until this week, however, federal officials were planning to let certain key components of the meal program expire at the end of September. Most notably, starting in August, families would have had to pay for their food and pick it up from the school their child attends.

“Today, we are . . . extending summer meal program flexibilities for as long as we can, legally and financially,” Agriculture Secretary Sonny Perdue said in a statement Monday. This will “ensure meals are reaching all children — whether they are learning in the classroom or virtually.”

Specifically, the extension means school officials can serve meals “in all areas and at no cost,” outside typical meal times and to parents and guardians who show up without their children, according to a USDA news release. The last item is an important one for families of immunocompromised children. Those families spoke up early in the spring to demand — and eventually win — that flexibility.

The extension will expire Dec. 31.

Roughly 30 million students across the United States eat school meals; of those, 22 million live in households whose income levels (at no more than 185 percent of the federal poverty level) qualify them for free and reduced-price meals. The number of families reliant on school meals for sustenance has probably increased over the summer, after the pandemic stalled the economy and drove unemployment sky high.

Perdue’s announcement Monday marks a significant reversal from his department’s previous position on the issue. School leaders nationwide had begun to sound the alarm about the meal program’s expiration in late August, as the start of school approached.

Officials in the Washington region warned that ending the program would force families to go hungry.

“If those flexibilities are not in place, the burden on our parents is going to be tremendous. I’m having nightmares,” Beverley Wheeler, director of the advocacy group D.C. Hunger Solutions, told The Washington Post.

But USDA officials had insisted that the flexibility already granted to school systems, such as the ability to deliver meals via bus routes, were sufficient to keep students fed.

In the news release Monday, USDA officials acknowledged the impact of the school leaders’ pressure campaign — even as they noted that the new extensions fall short of what had been requested.

“While there have been some well-meaning people asking USDA to fund this through the entire 2020-2021 school year, we are obligated not to spend more than is appropriated by Congress,” the release said. “Congress did not authorize enough funding for the entire 2020-2021 school year.”

School leaders have repeatedly said they need billions in federal funding to reopen schools safely in-person and effectively online. But Republicans and Democrats, locked in disagreement over how money for schools should be disbursed — among other conflicts — have yet to pass a stimulus package.