A prominent Republican got fewer votes than his opponent, but his party is rushing to enact sweeping changes that would limit the power of Democrats, potentially locking them out of policy-making for cycles to come.

No, this isn’t Donald Trump, and it isn’t Republicans in Congress.

In North Carolina, during late night session on Wednesday, the Republican-controlled state legislature introduced a series of bills deliberately meant to cut the powers of the governor’s office and the state’s election oversight board.

These bills include a requirement for the state senate to approve the governor’s Cabinet picks, end governor control of election boards, and add a limit to the governor’s influence over the University of North Carolina board of trustees, among others.

The backdrop is that North Carolina just elected Attorney General Roy Cooper, a Democrat, for governor in a tight race amid backlash from Incumbent Gov. Pat McCrory’s sweeping anti-LGBTQ measures.

Cooper had a narrow win on November 8, with a margin of victory of fewer than 10,000 votes — but McCrory didn’t concede until December 5, after a partial vote count concluded. Now, state Republicans are fighting to make sure Cooper has a particularly hard time governing.

Both bills have passed (McCrory signed one on Friday) effectively crippling Cooper from exercising the powers of the office McCrory himself enjoyed.

This is part of a longer history of state Republicans trying to change the rules in their favor. In 2011, after Republicans took control of both the state House and Senate, they passed a redistricting plan that would ensure Republican control in the state’s representation, and attempted to pass sweeping voting restrictions that disproportionally affected Democratic voters — measures that have thus far been successfully challenged in court as discriminatory.

What’s happening in North Carolina is a microcosm of what Democrats fear nationwide. Trump lost the popular vote, but won sweeping control over government anyway. If voting rights, and even gubernatorial powers, are so easily stripped after victory, it could put Democrats even further behind.

North Carolina Republicans are trying to strip the governor’s office of power before Cooper is sworn in

McCrory called state legislators back for a special session on disaster relief this week to address flooding after Hurricane Matthew and wildfires in western North Carolina. But when that special session ended, another was called without the governor, with the purpose of proposing bills to cut the powers of the governor’s office.

Two bills — the Senate Bill 4 and House Bill 17 — were proposed Wednesday, both of which take steps to drastically undercut Cooper’s powers come January 1. The bills would:

Cut the number of positions working directly for the governor from 1,500 to 300 (a number which was originally expanded from 400 for McCrory in 2013), limiting the number of Democrats Cooper can appoint to government.

Require that the governor’s cabinet appointments be approved by the state senate, which is currently controlled by Republicans.

Limit the number of appointments the governor can make to the state Board of Education and University of North Carolina board of trustees.

Change the state’s nonpartisan Supreme Court election process to a partisan one. In other words, Supreme Court nominees would have a “(D)” or “(R)” by their names on a ballot.

Require that cases go through a full court of appeals — which is currently controlled by Republicans — before going to the state Supreme Court, which currently has a Democratic majority.

Change the makeup of the state and county board of elections, which are currently set up to be in the governor’s party’s majority, to equally bipartisan boards, which would be led by Republicans in election years and by Democrats in non-election years.

When listed, there is no question that the proposed changes are a deliberate attempt to curtail the new Democratic governor’s powers once he takes office in January. Both bills have passed and McCrory has signed Senate Bill 4 into law. He has yet to sign the House bill. As one can imagine, the state’s Democrats are indignant.

“Rather than gracefully accepting the will of the state’s voters, they’re doing just about everything they can think of to undermine gubernatorial authority instead,” Carolyn Fiddler, Democratic Legislative Campaign Committee spokesperson, said in a statement.

The election board changes are particularly concerning

The changes to the state board of elections are particularly notable — and are being proposed under the guise of an ethical bipartisan makeover.

The State Board of Elections oversees recount requests and allegations of voter fraud and voting availabilities, like early voting openings, which North Carolina notably attempted to limit.

As it is now, the State Board of Elections is made up of five members — three from the governor’s party and two from the opposing party. County election boards are three members, two from the governor’s party and one from the opposing party.

The proposed Senate bill claims to want to create a bipartisan elections board — to “enforce ethics”; it would expand the state elections board to eight members, four from each party and county boards to four members, two from each party.

There’s a kicker, as Rick Hasen, an election law expert from the University of California Irvine, explained on his blog. Republicans would be in charge of these boards in the years that matter:

The Democratic party appointees to the election board would chair in odd numbered years, and the Republican party appointees would chair in even numbered years (see page 4 of the bill), meaning that they would chair in each of the years in which there are legislative, congressional, and presidential elections. … If the bill passes in this form, I could see potential Voting Rights Act and federal constitutional challenges here, in part because the legislature would potentially be diluting minority voting power and making minority voters worse off, just at the time that their candidate of choice (Gov. Cooper) is poised to assume power.

That North Carolina’s governor’s race went to a Democrat was a fight in itself

Changes to the state board of election are particularly triggering for Democrats this election cycle, after just spending nearly a month defending Cooper’s win over incumbent McCrory.

The results were in on November 8, but it took McCrory nearly a month to accept the loss, alleging voter fraud over absentee ballots, and claiming “hundreds of fraudulent Cooper ballots were found.”

He called for a partial recount of ballots in Durham County, a Democratic stronghold:

“With many outstanding votes yet to be counted for the first time, legal challenges, ballot protests and voter fraud allegations, we must keep open the ability to allow the established recount process to ensure every legal vote is counted properly,” said Russell Peck, Pat McCrory’s campaign manager said in a statement.

It was a last-ditch effort without much evidence to go off of from McCrory’s team, not dissimilar to Jill Stein’s recount efforts in Wisconsin, Michigan, and Pennsylvania.

Ultimately coming up short, McCrory conceded on December 5. But now with the legislature’s newly proposed bills, it seems his fight against Cooper is taking a different avenue.

Cooper doesn’t see these bills as the end, though.

“If I believe that laws passed by the Legislature hurt working families and are unconstitutional, they will see me in court,” Cooper said in a response to the Republican’s emergency session.

Republicans in North Carolina have been trying to change the rules for a while

Even before the second emergency session was announced on Wednesday, there were rumors of a Republican power grab, so much so that the executive director of North Carolina’s Republican Party released a biting statement denying specific allegations that the legislature may attempt to expand the state Supreme Court or implement other partisan measures.

.@AlHuntDC you should know that at the Executive Director of the @NCGOP this memo was directed at u Mr. Hunt. Don't you have any standards? pic.twitter.com/9a52hUfRf9 — Dallas Woodhouse (@DallasWoodhouse) December 14, 2016

Although wrong in their premature allegations, Democrats were not completely unmerited in their weariness. Especially after the controversial bathroom bill in March, they have become somewhat accustomed to these antics.

And there is precedent in the state for changing the rules when in power. After Republicans won control of the legislature in 2010, they proposed a new redistricting plan that would help keep them a congressional majority — in a state that’s becoming rapidly more urban. A case over the racial implications of their most recent redistricting map is currently being heard by the US Supreme Court.

Since 2013, the Democrats have also been fighting one of the strictest voting rights laws in the country in North Carolina. That law heavily limited early voting, required Voter ID laws, and eliminated same-day registrations — courts struck down some major parts of these reforms before the 2016 election.

There’s some explicit evidence to the partisan politics behind these efforts, after a GOP consultant told the Washington Post that the push in North Carolina was to minimize African-American Democratic voters.

"Look, if African Americans voted overwhelmingly Republican, they would have kept early voting right where it was," the consultant, Carter Wrenn, said. "It wasn’t about discriminating against African Americans. They just ended up in the middle of it because they vote Democrat."

All of these moves are troubling for Democrats across the country, who enter 2017 without control of the White House, Senate, or House of Representatives and stand to lose seats in the Supreme Court over the course of the next four to eight years.

There’s a danger that even with electoral victory, their hands could be tied.