HARRISBURG — Gov. Wolf on Friday announced that he would allow an education-funding bill to become law although it contains a provision, stripping seniority protection from teachers in layoffs, that has angered an important part of his coalition.

The bill, known as the education code, authorizes spending for public school districts, but is packed with policy changes for public schools.

"Gov. Wolf believes components of this bill are important: delaying the Keystone Exams, expanding opioid education in schools, curbing 'lunch shaming,' and providing additional funding to help distressed school districts," his spokesman, J.J. Abbott, said in a statement. "Though there are components of the bill that he has concerns about, particularly Republican plans around teacher evaluation and termination, he will allow it to become law but withhold his signature."

The bill will become law Monday, ending a four-month budget impasse. Teacher unions expressed dismay over the layoff language, which relies on evaluations they believe are arbitrary.

Jerry Jordan, president of the Philadelphia Federation of Teachers, said he was "really disappointed" in the governor's decision.

"It's a very big concern," said Jordan. "It's based on a flawed evaluation system. It's very subjective and arbitrary, not a fair way to evaluate teachers."

Under the evaluation system, Jordan said, teachers who are judged as exemplary by their principals can end up with "needs improvement" ratings overall because they work in struggling schools. Such teachers could in theory be laid off if performance evaluations are used as the criteria.

Other teachers' unions, including Pittsburgh's, have expressed similar concerns.

The education code also has a clause that delays the requirements that high school students pass standardized tests known as the Keystone Exams to graduate. It also prohibits "lunch shaming" by requiring schools to provide lunch to students regardless of whether they owe money.

Wolf, a Democrat, signed other budget bills this week, including one that authorizes borrowing against the state's landmark settlement with tobacco companies — though that still needs approval from the Commonwealth Financing Authority — and another that widely expands gambling in the state.

Legislators passed in late June a nearly $32 billion spending plan and jostled for nearly four months over how to pay for it. During that time, the state experienced a credit downgrade.

Staff writer Kristen A. Graham contributed to this article.