"I am tremendously moved. I am finding it difficult to keep my composure. It's been a long race," said Isabel Amor of the Fundacion Iguales rights group, who was in the chamber for the vote.
LGBTQ rights group Movilh said the move was "an historic and decisive step" for same-sex couples and parents "who, without exception, were being discriminated against."
The bill got the green light from the upper house of Congress, or the Senate, on Tuesday and was immediately given the final stamp of approval by the lower Chamber of Deputies, with 82 votes to 20.
There were two abstentions.
'One really feels dignified'
In Latin America, same-sex couples could until now get married only in Costa Rica, Ecuador, Colombia, Brazil, Uruguay and Argentina, as well as in 14 of Mexico's 32 states.
Chile legalised same-sex civil unions in 2015 and has been awaiting the passage of the marriage bill since then-president Michelle Bachelet sent it to Congress in 2017.
In a surprise move, her conservative successor Mr Pinera announced in June he would seek the urgent passage of the bill - supported by a majority of Chileans - through Congress.
The project has been consistently opposed by the most conservative bloc of Chile's ruling right-wing, but has nevertheless obtained a majority "yes" vote at every step of the process in an opposition-dominated Congress.
"It is something very significant. One really feels dignified as a human being, as a person," Ramon Lopez, who had been waiting for the law to marry his partner of 21 years, told AFP at the gates of Congress.
"This opens the doors and breaks down all those prejudices," he said.
Abortion still illegal
The issue deeply divides the two candidates headed for a presidential run-off on December 19.
Gabriel Boric, 35, who represents a leftist alliance that includes the Communist Party, supported the bill and voted "yes" in his capacity as lawmaker.
But 55-year-old far-right candidate Jose Antonio Kast, who won 28 percent of first-round votes compared to Boric's 26 per cent, campaigned against it.
Kast, who also opposes elective abortion, has since softened his vocal opposition to same-sex marriage, as he seeks to attract voters from the center.
Last week, Chile's Congress shelved a bill to decriminalise abortion, pending an edit of the text, effectively putting it on ice for at least a year.
Chilean couple ready to tie the knot after same-sex marriage approval
The marriage bill was delayed on the same day to iron out differences of legal interpretations of certain technicalities.
The necessary adjustments were made over the past week by an expert committee of senators and lower house deputies.
The law recognises equal rights and obligations for all married couples regardless of their gender.