SAYNER, Wis. — Two Republican state senators lost their seats in recall elections around Wisconsin on Tuesday, but Republicans maintained their control of the State Senate, ultimately handing a defeat to union groups and Democrats who had spent months and millions of dollars trying to wrestle away at least some of the state’s political power.

The outcome was seen as a victory for Gov. Scott Walker, a Republican whose move to curtail collective bargaining rights for public workers this year set off a firestorm of protests, then counterprotests and finally a summer of unprecedented recall efforts.

Although two of the Republicans — Senators Dan Kapanke of La Crosse and Randy Hopper of Fond du Lac — were removed by Democratic challengers on Tuesday before the ends of their terms in office, Republicans still hold a majority — now 17 to 16 — over Democrats in the Senate. Until Tuesday, Republicans had dominated with a 19 to 14 majority, but with six recall elections in a single day, the damage for Republicans could have been far worse, and Democrats and some national labor groups had hoped it would be.

Two Senate Democrats also face recall elections next week — one more chapter in the same collective bargaining rights battle — but given the results on Tuesday, those races now cannot affect which party controls the State Senate, the question that had always been the ultimate concern on both sides. If anything, Republicans could now increase their hold next week.