RALEIGH, N.C. (AP) — North Carolina Gov. Roy Cooper and fellow Democrats gained influence Tuesday at the currently Republican-dominated legislature for the next two years, breaking the GOP’s veto-proof majority in the House and making inroads in the Senate.

Democrats gained at least eight additional House seats — well over the four needed to end the Republicans’ complete control of the chamber. A Democrat also led in a very close House race, while Republicans led in two more. In the Senate, Democrats gained at least three additional seats and were leading in three others. They would break veto-proof control in the Senate if they ended up winning the remaining three.

Democratic gains mean the Republicans’ run of dominance at the Legislative Building this decade will be curbed. Cooper now has more chances to implement his favored programs and policies before his 2020 re-election bid.

Voters also handed defeats to Republican lawmakers by rejecting two constitutional amendments they put on the ballot that would have swung authority over filling judicial vacancies and the elections board from the governor and toward the legislature. Both failed after being opposed by all living governors, both Republican and Democrat. The other four amendments on the ballots were approved, including one to mandate photo identification to vote in person.

But Democrats had a harder time in U.S. House races, as GOP Reps. Ted Budd in the 13th District and George Holding in the 2nd District successfully fought off strong Democratic candidates. And nearly complete results showed Republican Mark Harris with a razor-thin lead over Democrat Dan McCready in the 9th District. A recount was possible. Should Harris win, Republicans would continue to hold 10 of the state’s 13 House seats.

With no high-profile statewide races this fall, the electoral battle for control of the General Assembly became the climax of a two-year, headline-grabbing power struggle between Cooper and legislative leaders. Although North Carolina has come to be seen as a swing state nationally, its state legislature has been deeply Republican for nearly a decade, aided by favorable redistricting. Voters narrowly elected Cooper in 2016 while also choosing Republican Donald Trump for president.

Cooper had a lot to do with the political offensive that resulted in additional legislative seats. He helped raise over $7 million for the state Democratic Party to assist legislative candidates in the “Break the Majority” effort. He also raised hundreds of thousands of additional dollars for individual candidates.

The GOP’s veto-proof control essentially rendered Cooper ineffective on his legislative priorities since becoming governor. He’s sought redress in the courts through several lawsuits challenging laws that eroded his power, leading to some judicial victories.

Cooper will now have more negotiating power to press for covering another 500,000 working people who lack health insurance through Medicaid, which has been one of his top priorities. He’ll also be in a better position to press for raising teacher pay to the national average.

Democrats fell short of winning the 16 additional House seats and 11 more Senate seats overall to retake majorities for the first time since 2010.

But state Democratic Party Chair Wayne Goodwin said in a release the party still reached its goal of “breaking the Republican supermajority and electing a legislature that will work with Gov. Cooper to invest more in education, expand access to affordable health care and support working families.”

In addition to the photo ID requirement, a majority of voters approved constitutional referendums on hunting and fishing rights, expanding crime victims’ rights and lowering the current income tax rate cap from 10 percent to 7 percent.

House Speaker Tim Moore and Senate leader Phil Berger gave their own take on Tuesday’s outcomes, saying that with continued GOP majorities, voters “issued a clear mandate to continue Republican policies that are benefiting the workforce, improving schools, and delivering a pro-jobs agenda for families.”

Paul Seaton, 37, an unaffiliated voter from Raleigh, said he voted Tuesday for all Democrats to serve as a counterweight to Republicans in the federal and state government.

“I guess my only reason that I voted for all Democrats was just a balance, that there needed to be a little more balance to the extreme on the other side in some cases,” said Seaton, a community college student.

Seaton said Republicans also didn’t get his votes because they put on the ballot a constitutional amendment that if approved would mandate voters having to show a photo identification to vote in person.

Anne Jenkins, 61, a Raleigh nurse, said Tuesday she voted for Republicans as well as the amendments.

“I feel like the Republicans supported them and the Democrats didn’t, and I didn’t have any problem with the amendments,” Jenkins said. “I saw nothing wrong with any of them.”

In other races, Anita Earls was elected to unseat Justice Barbara Jackson. Earls’ victory means Democrats now will hold five of the seven seats on the court.