Hungary's Constitutional Court Sept. 4 equalized the age of consent for gay and straight sex at 14. Gay sex was previously illegal prior to age 18.
The move is, in no small part, a response to demands made by the European Union of nations that want to join the EU, which forbids members from discriminating against gays.
The EU also persuaded Cyprus to equalize its age of consent recently.
"The criminal code discriminated against homosexuals in an arbitrary and objectively unjustifiable way," the court said in its verdict.
The court reportedly also deleted some passages in the criminal code that labeled gay sex "lewdness against the order of nature."
In 1995, the Constitutional Court extended the rights and obligations that apply to unmarried opposite-sex couples to cover same-sex couples as well, creating a kind of common-law gay marriage.
According to the International Lesbian & Gay Association ( ILGA ) , Hungary needs to repeal one additional law. It prevents people under age 18 from joining gay-rights groups.
"The Constitutional Court's ruling is a great and long-overdue victory for Hungary's LGBT movement," said Ailsa Spindler, executive director of ILGA's European division. "The Hungarian government must now go the final step in accepting European human-rights standards, and eliminate its restrictions on the freedom of association of young lesbians, gays and bisexuals."