HARRISBURG, Pa. (AP) — Preparations are far along for two Pittsburgh-area special elections that the Republican leader of the Pennsylvania House has filed a lawsuit to delay past their scheduled date in early February.

With Democrats and Republicans nearly even in the state House, the two special elections could determine partisan control of the chamber.

On Wednesday, a lawyer for the Allegheny County Elections Bureau told a three-judge Commonwealth Court panel that ballots were ready to be printed, machines have been tested and most of the polling places and elections workers have been lined up. Some voters have begun to get notices they should expect to receive mail-in ballots soon.

“The vendors have not begun to mail them” but that has to happen next week to comport with the Feb. 7 election date, Allegheny County attorney Lisa Michel said near the end of two hours of argument in the case.

Get the latest Pennsylvania politics and election news with abc27 newsletters!

The House Republican floor leader, Rep. Bryan Cutler of Lancaster County, wants the court to invalidate two “writs” of election issued last month by his Democratic leadership counterpart, Rep. Joanna McClinton of Philadelphia.

Cutler’s lawyer, Drew Crompton, told the judges — two Democrats and one Republican — they should issue an injunction against holding the special elections. The votes are meant to fill vacancies created when recently reelected Rep. Austin Davis resigned to become lieutenant governor, and Rep. Summer Lee left to take a seat in Congress. Both are Democrats.

Crompton said the crux of Cutler’s claim is that McClinton was not majority leader in early December when she signed the two writs. She also set a Feb. 7 special election for another vacancy, created by the death of a third Democrat who won reelection, Rep. Tony DeLuca, but Cutler is not challenging that date.

Democrats won a net of 12 seats in November, barely enough to retake majority control of the House after a dozen years. But the three vacancies have left Democrats with just 99 members to the Republicans’ 101, a margin so close that Democratic Rep. Mark Rozzi of Berks County was elected earlier this month to serve as an independent speaker.

“It is imperative that we have writs that are grounded on the authority of the leaders,” Crompton said, adding that it’s “a substantial power to call a special election.”

McClinton’s lawyer, Dan Brier, told the judges the case involved the type of “political” question about the House’s internal operations that the courts should avoid. He also said an injunction would do more harm than good because it would leave residents of the two districts without state representatives for three more months.

“The public interest is that there’s two seats where there’s over 100,000 Pennsylvanians who are unrepresented, and they’re entitled to representation,” Brier argued.

Justin Weber, the attorney representing acting Secretary of State Leigh Chapman, told the judges the state’s election machinery is already in gear.

“There is great deference to the election process when it’s put in motion, as it was on Dec. 7,” when McClinton set the elections, Weber told the judges.

Cutler sued two days after McClinton set the special elections and has proposed holding them on the May 16 primary date instead. Upon taking the gavel as speaker Jan. 3, Rozzi immediately endorsed McClinton’s timeline.

The judges did not indicate when they will rule.