This makes the Central African country one of the few in sub-Saharan Africa to change a law that punishes sexual relations between people of the same sex.
Last year, Gabon criminalised homosexuality making gay sex punishable with six months in prison and a large fine.
Forty-eight Members of Parliament supported the proposal to change the 2019 law and lift the ban. Meanwhile, 24 MPs opposed the amendment.
However, same-sex marriage is still now allowed in the Central African country where homosexuality is still broadly seen as a social taboo.
Meanwhile, Gambia has said that it would neither decriminalise homosexuality nor review its laws.
This response is coming after a few weeks of controversy over homosexuality in the West African country.
A statement from the government denied public rumours that it intends to relax homosexuality in exchange for aid funds.
According to the AFP, the government spokesperson Ebrima Sankareh said “This is false political propaganda orchestrated to score cheap political points.”
He said the government continues to be guided by “the norms of its people” and “has no plans to either decriminalise or even entertain a review of laws on homosexuality.”