A New Jersey law will give $7 million in state funds to a consortium of Orthodox yeshivas in Lakewood to spend on school busing, even as the cash-strapped school district struggles with a crippling financial crisis.

The windfall comes after state-appointed monitors in the Lakewood school district threatened to cut busing to all public and private school students who live within two miles of their school as a cost-saving measure.

The law averts those cuts by transferring the cost of busing for yeshivas from the overburdened school district to the state.

“This bill ensures all nonpublic school students can get to school safely, while easing the financial burden on the district,” New Jersey governor Chris Christie said in a statement.

While many states pay for transportation for non-public school students, few actually give transportation dollars to non-public schools to spend themselves. The New Jersey law sets up a three-year pilot program in Lakewood in which the transportation funds would be spent by a group of non-public schools, mainly yeshivas, and not the school district.

The law comes after state-appointed monitors overseeing the city’s troubled school district threatened to cut busing services to 10,000 public and private school students in the district who live too close to their schools to be entitled to busing under state law. The monitors also threatened to cut scores of teaching positions and all middle school sports and clubs.

Lakewood’s Orthodox community, centered around the ultra-Orthodox Beth Midrash Govoha, has grown explosively in recent years. The school district has struggled amid the growth to provide mandated services to the private yeshivas attended by the Orthodox children. A monitor, appointed by the state in 2014 to address the district’s spiraling debt, has struggled balance the school’s budget.

State law requires that public school districts pay for busing for students at private schools who live more than two miles from school. Lakewood had also been providing what it called “courtesy busing” to private and public school students who lived less than two miles from their schools.

The monitor proposed in May to end all courtesy busing. Parents rebelled. In June, the state legislature stepped in, passing a bill that would alleviate the district’s busing crisis by shifting the responsibility for private school busing from the district to the state.

The bill, which New Jersey governor Chris Christie signed into law August 9, will give a consortium of Lakewood private schools $2.4 million a year for three years to pay both mandated and “courtesy” busing for their students.

Township officials have said that, with the state aid in place for non-public school students, they will be able to continue to provide courtesy busing for public school students.

In his statement, Christie called the $7 million infusion a “temporary solution,” and asked the city to set aside funds to improve its transportation infrastructure so that students “can safely walk to school.”

Contact Josh Nathan-Kazis at nathankazis@forward.com or follow him on Twitter, @joshnathankazis.