The law, backed by the center-left government of President Cristina Kirchner, was adopted in a 33-27 vote after 15 hours of debate. In this majority Roman Catholic country, some had reservations, but the law passed.
"It is a historic day," said ruling party leader Miguel Pichetto.
Opposition Radical senator Gerardo Morales said Argentine society has changed, stressing that the bill was aimed at guaranteeing the rights of minorities.
Hundreds of people outside Congress cheered when the bill passed. Some chanted "Equality, Equality." Some tearful couples embraced.