Japan is the only Group of Seven nation without legal protection for same-sex unions. Although backed by 70% of the public, they are opposed by the conservative Liberal Democratic Party of Prime Minister Fumio Kishida.
Japanese civil code rules that limit marriage to those of opposite sexes are "unconstitutional" and "discriminatory", the Sapporo High Court said in its ruling, but dismissed the plaintiffs' claim for damages from the government.
"Enacting same-sex marriage does not seem to cause disadvantages or harmful effects," the court said.
"I thought the ruling might be a conservative one, but it ended up exceeding my expectations," one plaintiff, who did not disclose his name, told reporters after the ruling. "I couldn't help but cry."
The plaintiffs are considering appealing to the Supreme Court to clarify the unconstitutionality of existing law, lawyer Tsunamori Fumiyasu told a press conference.
The government will keep its eye on other upcoming court decisions on the matter, its top spokesperson, Yoshimasa Hayashi, told a press conference.
The debate on the same-sex bar has split lower courts, with one district court holding the bar to be constitutional but others saying it is unconstitutional in varying degrees.
Earlier on Thursday, a ruling by the Tokyo district court described the lack of same-sex marriage status in Japan as "a state of unconstitutionality", employing language less strong than in some past rulings on such lawsuits.
(Reporting by Sakura Murakami and Kantaro Komiya; Editing by Jacqueline Wong and Clarence Fernandez)

Plaintiffs hold a banner after the ruling on same-sex marriage at the Tokyo District Court in Tokyo, Japan, 14 March 2024. Following a lawsuit filed by eight plaintiffs, the Tokyo District Court declared unconstitutional the lack of legal recognition of same-sex marriage in the country. This is the third case in which a court has made this decision but the compensation claims were dismissed. EPA-EFE/JIJI PRESS JAPAN OUT