A federal judge has rejected an attempt to end a ban on same-sex marriages in Puerto Rico, saying political order itself depends on traditional marriage and deriding the logic of courts that have overturned such bans. The five gay couples who filed the suit will appeal, their attorney said Wednesday.

The couples had challenged the constitutionality of several local laws, including a 1902 code that defines marriage as between a man and a woman.