MADISON, Wis. — Wisconsin Gov. Scott Walker reluctantly issued an executive order Thursday scheduling special elections to fill two vacant legislative seats, as Senate Republicans abandoned their efforts to block the contests amid Democratic criticism that the GOP is afraid of losing more seats.

The seats — one in the state Senate and one in the Assembly — have been vacant since December, when Walker appointed the Republican incumbents to his administration. State law requires Walker to call special elections to fill legislative vacancies that occur prior to May in regular election years such as this one but he had refused to do so, calling the special elections a waste of taxpayer money with the seats coming up for election in the fall.

Democrats have argued that Walker wants to avoid losing the seats to their party in a year that appears to favor Democrats. A group led by former U.S. Attorney General Eric Holder sued to force the special elections. The group won an order from a Madison judge last week forcing Walker to call the elections by noon Thursday.

Walker initially refused to accept the court order but lost an appeal Wednesday.

State attorneys had contemplated asking the Wisconsin Supreme Court — which is controlled by conservative justices — to step in but ultimately decided against making the request. The governor issued the scheduling order as mandated, setting primaries for both open seats on May 15 with the general special election to follow on June 12.

His office announced the order in a news release with no additional comments. But the governor took Holder to task in a series of tweets, accusing him of forcing Wisconsin to spend tax dollars on duplicative elections. The governor charged that Holder and other liberals from Washington, D.C., are using the situation to raise money for the November elections.

Meanwhile, Senate Majority Leader Scott Fitzgerald introduced a bill this week that would prohibit special elections after the spring election in a regular election year. Without the special elections, the seats would effectively remain empty until January, when winners in the regular November election would be sworn in.

But Fitzgerald told WTMJ-AM minutes after Walker scheduled the elections that he was dropping efforts to move the bill forward in the wake of the judge's order.

"The governor was boxed in," Fitzgerald said. "He couldn't go beyond noon today or the threat of contempt was hanging out there. We don't know what it would look like, but it's certainly not a good place to be."

Republicans have lost more than 30 legislative seats nationwide since President Donald Trump took office. One of them was in Wisconsin, where Democrat Patty Schachtner won an open state Senate seat in a traditionally Republican district in January. Walker branded her win a wake-up call for the GOP. Earlier this month, Democrat Conor Lamb captured what been a reliably Republican congressional seat in Pennsylvania.

"Scott Walker's attempts to undercut our judicial system and create chaos show just how intimidated he is by the voters of Wisconsin," Assembly Democratic Minority Leader Gordon Hintz said in a statement.