RALEIGH, N.C. — Republican legislation phasing in smaller class sizes in North Carolina passed the Senate on Friday in a measure that most Democrats begrudgingly voted for even as they complained it contained other unrelated provisions that could hurt the Democratic governor.

Nine of the 14 Senate Democrats joined all Republicans on the floor voting 37-5 to approve the negotiated measure with the House, which will take up the bill Tuesday. A positive House vote would send the bill to Democratic Gov. Roy Cooper, who could sign it, veto it or let it become law without his signature.

Democrats accused Republicans of forcing their hands by agreeing to vote for the class-size fix in exchange for the Democrats accepting other items that could harm Cooper — namely changes to the combined state elections and ethics board and an agreement related to a proposed natural gas pipeline.

Negotiated in the bill , with no parliamentary method available to remove it, is language adding a new ninth board member that must be neither a Democrat nor a Republican and gives the governor the ability to remove any member at his pleasure. The Republicans made the change in response to a Supreme Court ruling two weeks ago that favored Cooper. But Cooper wants the board returned to what it was for decades until recently, with the governor’s party getting a majority of seats. One Senate Democrat suggested this latest proposal would wind up in court, too.

The class-size fix is a top issue for school administrators, teachers and parents in the lawmakers’ districts.

“Some of us will hold our nose and vote for it because we’re concerned about the kids, but it’s bad. It’s really bad,” Rep. Paul Lowe, a Forsyth County Democrat, said during floor debate. “You didn’t have to do it this way. You have the strength, the power and the votes to do it this way, but it’s wrong.”

The bill also would require that $57.8 million that utilities behind the proposed Atlantic Coast Pipeline have agreed to provide will go to schools in eight eastern counties along the pipeline’s proposed route.

A memorandum of agreement Cooper reached with the pipeline operators designates the money for environmental mitigation, economic development and renewable energy. But Republicans said Cooper overstepped his authority in reaching such an agreement.

They spent Thursday — to the distaste of Democrats — in a committee grilling the governor’s new lobbyist about the agreement and questioning whether the money was a prerequisite for the administration to issue a key water permit two weeks ago. Cooper’s aide said repeatedly the permit and agreement were worked out separately.

“We, the legislature should determine where funds that are raised on behalf of the state of North Carolina” go, said Sen. Paul Newton, a Cabarrus County Republican. “This body appropriates those funds.”

The bill passed by the Senate would lower teacher-student ratios in kindergarten through third grade in phases, bringing them fully into effect in the fall of 2021. Initially, the process was proposed to begin next fall. Now, it will start in fall 2019. Districts also would get to share $61 million next fall to pay for certain types of specialty instructors, such as those who teach music and art, with the amount increasing rapidly over the following three years.

Democratic Sen. Jay Chaudhuri of Wake County blasted Republicans for setting “fire to our public education system” by failing to address the issue sooner and creating insecurity among teachers and parents.

“The Senate has elected to play politics with our children’s future by passing a political bill during this political season,” Chaudhuri said.

Republicans said they followed the chamber rules in fashioning the omnibus measure. GOP Sen Chad Barefoot of Wake County, who helped negotiated the class-size agreement, questioned Chaudhuri’s commitment to fixing the problem.

“The real reason he doesn’t support this bill is because his loyalty to the governor is more important than his loyalty to the public schools,” Barefoot said.