The targeted challenges were among the toughest primary races in a year in which all 118 House seats and a third of 59 Senate seats are up. Overall, there were 27 primary contests for House seats this month, but just two in the Senate.

Among Republicans, one of two House members running for re-election who voted in favor of gay marriage last fall survived a challenge fueled conservative family groups. Rep. Ed Sullivan defeated bus driver Bob Bednar, both of Mundelein. The other, Rep. Ron Sandack of Downers Grove, was trailing Waubonsee High School teacher Keith Matune late Tuesday, but the race was still too close to call.

Sullivan said his race ultimately came down to fiscal issues.

“My district does not believe that marriage equality is the number one issue,” he told The Associated Press.

AFSCME, the state’s largest employee union, and other organized labor groups teamed up in an effort to defeat several Democratic House members from Chicago who supported the pension overhaul. The measure, approved by lawmakers in December, is estimated to save $145 billion over 30 years, largely by cutting workers benefits.

Six-term Rep. Toni Berrios lost her primary election to journalist Will Guzzardi, who had heavy support from unions fearful lawmakers would turn next to cutting municipal employee pensions. Berrios had narrowly defeated him in 2012.

“We said with one voice that working people who earned their retirement deserved to get it,” Guzzardi told a crowd of supporters in Chicago.

However, state Rep. Jaime Andrade, Jr. fended off four challengers, including attorney Nancy Schiavone, whose campaign was bankrolled by unions.

The other challenged incumbent, state Rep. Christian Mitchell, led Jhatayn “Jay” Travis, a community organizer who had hundreds of thousands of dollars in union support.

Democrats still stand a good chance of holding onto their veto-proof supermajorities in both legislative chambers this year, but the challenges could serve as a lesson to moderates in both parties facing difficult votes ahead.