A marriage equality law in Switzerland that recently survived a public referendum will take effect on July 1, the government announced on Wednesday.

The government also announced that it will recognize same-sex marriages from other countries on January 1.

Lawmakers approved the “Marriage for All” bill last year but opponents of the legislation quickly gathered the 50,000 signatures needed to get it on the ballot.

Swiss voters in September voted overwhelmingly in favor of the bill.

Switzerland has recognized gay and lesbian couples with registered partnerships since 2005. But marriage includes additional rights, such as the joint adoption of children.

According to a survey commissioned last year by Pink Cross, an LGBT rights group, a large majority of Swiss (80%) support same-sex marriage. Support is high even among conservatives. Pollsters found 67 percent of respondents who said that they are members of the Swiss People's Party in support of equal marriage rights.

The marriage bill was first introduced in 2013.