New York has become the sixth and most populous US state to allow same-sex marriage.
The Republican-controlled state senate voted 33-29 for a bill that had earlier been approved by the lower house, which has a Democratic majority.
New York Governor Andrew Cuomo quickly signed the bill into law. Gay weddings are expected to start within 30 days.
It has become a contentious social issue ahead of next year’s presidential and congressional elections.