Following more than 14 hours of charged debate, during which thousands of Argentinians protested outside the congress, the upper house voted 33-27 for the proposal, with three abstentions.
"I believe this has advanced equal rights," Senator Eugenio Artaza said after the debate, in which many senators invoked their Catholic beliefs to explain their stance.
Argentina's president, Cristina Fernández, supports same-sex marriage on human rights grounds and is expected to sign the bill into law after her return from a state visit to China. It cleared Argentina's lower house in May.
The vote was 33-27 in favor of the passage. There's no word on whether this will spread throughout the rest of South America.