Illinois Gov. Pat Quinn holds up the Illinois marriage equality bill after signing it into law on Nov. 20, 2013 in Chicago, Illinois. Scott Olson/Getty Images

Illinois Gov. Pat Quinn signed legislation Wednesday allowing same-sex weddings starting this summer, making President Barack Obama's home state the 16th overall — and largest in the nation's heartland — to legalize gay marriage.

Speaking in front of thousands at the University of Illinois at Chicago, Quinn said the new law ensured that "Illinois does not have a situation where individuals are discriminated against in any way when it comes to love and marriage."

Illinois state senators voted to legalize gay marriage last February, and the state House followed suit by a slim margin earlier this month. After being signed by the Democratic governor, the law is due to take effect on June 1, 2014.

Gay marriage is now legal in Washington D.C., and 15 other states including Hawaii, whose governor signed a similar measure last week.

Even with support from top business leaders, Chicago Mayor Rahm Emanuel, the state attorney general and a few top Republicans, several lawmakers were resistant to the idea. That included Democrats in more conservative southern Illinois and some Chicago-area lawmakers.

"We've realized that to have a forward-looking state, you cannot have backward-looking laws that discriminate against good and talented people, regardless of their sexual orientation," Emanuel said at Wednesday's ceremony.

The measure was fought hard by some of the state's most well-recognized religious figures, including Cardinal Francis George of the Archdiocese of Chicago and the Rev. James Meeks, a former state senator who runs a politically-influential church in Chicago.

Meeks was part of a coalition of pastors who said marriage should remain between a man and woman and sponsored robocalls in several legislative districts and on the airwaves.

But proponents launched an equally aggressive campaign with help from unions, the former head of the Illinois Republican Party and the American Civil Liberties Union (ACLU). They billed the measure as a matter of civil rights and equality for families.

Although Illinois once appeared poised to become the first Midwestern state to approve gay marriage through a legislative vote, Minnesota did it sooner and started holding its first same-sex weddings over the summer. Iowa also allows gay marriages but through a court ruling, not its legislature.

When the law takes effect June 1, same-sex couples can begin applying for marriage licenses. And Cook County — the state's most populous — has said it'll be open for business that day even though it's a Sunday.

There's a small chance weddings could take place before then; legislation is pending that could make the law effective immediately. Lawmakers aren't expected to gather for a regular session until the end of January.

Wire services