New York legislators passed a bill legalizing gay marriage in the state on Friday night, with the state Senate approving the bill to a cheering room before 11 p.m.

The state’s Assembly passed a version of the bill that included an amendment about religious institutions earlier in the day, CNN reported. The late-night vote now puts the bill in the hands of New York Gov. Andrew Cuomo, who proposed the bill.

Once the bill is signed, New York will become the sixth and largest state to have approved same-sex marriage.

Currently, same-sex marriage licenses are granted in Massachusetts, Connecticut, Iowa, Vermont and New Hampshire and the District of Columbia.

In 2009, the New York state Senate rejected a bill to legalize gay marriage and the last three attempts at passing similar bills were blocked.

[CNN]