Kentucky state Attorney General Andy Beshear is a Democrat and a thorn in the side of the Republican governor. So Republicans in the state senate are trying to roll back the powers of his office.

Despite Republicans holding a decisive majority around the country, Democrats remain in control of a number of important offices, including many which are essential checks on corruption and abuse of power by GOP majorities in state governments.

One such Democrat is Andy Beshear of Kentucky. The son of a a popular and successful former governor, Beshear was elected Attorney General in 2015, and he has been a constant opponent of GOP governor Matt Bevin ever since. Last year, Beshear brought a lawsuit in state court against Bevin’s unlawful cutbacks to the state education system. He also refused to defend challenges to the state’s 20-week abortion ban, which Bevin supports.

Now, knowing that Beshear has been an effective check on the governor, Republican state legislators are trying to strip his office of authority.

In February, the Kentucky House of Representatives introduced HB 281, which changes the rules for how the Attorney General and some other officials go about hiring outside attorneys. It was sold as a bipartisan pro-transparency reform, but some observers argued it was an underhanded ploy to limit Beshear’s power.

And now Republicans in the Kentucky senate removed all doubt about the purpose of the bill by unexpectedly proposing new language in the Judiciary Committee. The modified version of the bill would completely strip the Attorney General of power to represent the Commonwealth of Kentucky in most civil cases, in any state or federal court, and instead give that power to lawyers serving at the pleasure of the governor:

This is just the latest of several cases in which Republicans moved to change state laws to diminish or erase the authority of elected offices which happen to be held by Democrats.

Last December, the GOP-controlled North Carolina General Assembly rammed through laws that curtailed the power of Democratic Governor-elect Roy Cooper to appoint cabinet officials, state election and ethics boards, and university trustees. It was such a blatant subversion of the electoral process that the Election Integrity Project no longer ranks North Carolina as a democracy.

And as Governor of Indiana, Mike Pence removed the superintendent of public instruction from the State Board of Education after Democrat Glenda Ritz was elected to the office — despite the fact that she actually won more votes than Pence did for Governor.

All over America, Republicans have shown themselves willing to retaliate against Democratic officeholders in ways that threaten the rule of law and subvert the will of the voters. If HB 281 becomes law in its proposed form, it will not only punish Beshear for doing his job, it will punish the voters for electing him to do that job. And that should trouble anyone who values our democracy.