Hong Kong's top court has ruled that the territory must provide legal recognition for same-sex couples.
The judgment from the Court of Final Appeal rejects petitions to expand the current legal definition of marriage to include same-sex couples and to recognise same-sex marriages that took place overseas.
However, the court has given the Hong Kong government two years to create a new legal framework that grants them some legal rights.
Justices Joseph Fok, RAV Ribeiro and Patrick Keane dismissed suggestions that such a legal framework would be unworkable.
They ruled that legal recognition for same-sex couples was "required to meet basic social needs similar to those experienced by different-sex couples in stable relationships".
"Secondly, the absence of legal recognition has been seen to be essentially discriminatory and demeaning to same-sex couples," they said.
Although homosexuality has been decriminalised in Hong Kong since 1991, same-sex marriages or civil unions are not permitted.
The campaign for same-sex marriage in Hong Kong has been led for the last five years by activist Jimmy Sham Tsz-kit, who married his same-sex partner in New York in 2013.