The Indian Parliament has voted to keep gay sex illegal.

Shashi Tharoor, the National Congress Party MP, introduced a private members bill which would have overturned Section 377 of the country’s Penal Code making gay sex illegal.

Tharoor said the law “violates the fundamental rights” of gay and bisexual people living in India.

According to Section 377, introduced 153-years-ago, same-sex relations are an “unnatural offence”.

It makes gay sex punishable with up to 10 years in jail.

The MP said he plans to “try again in future” to topple the law, which after being removed in 2009 by a court, was reinstated by the country’s Supreme Court in 2013.

The Delhi high court decriminalised gay sex by ruling that Section 377 was discriminatory. But the high court in 2013 reversed the lower court’s order.

Tharoor wrote on the Quint website that “it is time to bring the Indian Penal Code into the 21st century”.

“Section 377 of the Indian Penal Code was enacted in 1860, and criminalises ‘carnal intercourse against the order of nature’ – a term so archaic that it would invite derision in most modern societies,” he wrote.

MPs in India have been lobbied by gay rights activists to remove the law, but several governments have chosen not to act on the issue.

Indian society sees homosexuality as taboo, and same-sex relationships are widely regarded as illegitimate.