A court in Peru has recognized the Mexican marriage of a gay couple.

According to the AP, the court on Monday recognized the marriage of two men. The outlet called it a historic first for the staunchly Roman Catholic nation.

Peruvian LGBT rights activist Oscar Ugarteche sued after he was unable to register his marriage to his Mexican partner, Fidel Aroche. The couple, together 17 years, married in Mexico City in 2010. Ugarteche wanted to change his marital status on his passport.

The recognition is limited to same-sex marriages performed outside Peru and the government has said it will appeal the ruling.

Shortly after Congressman Carlos Bruce introduced a bill that sought to recognize same-sex relationships with civil unions in 2014, he came out gay, making him the first openly gay member of Congress in Peru.

Lawmakers rejected Bruce's civil unions bill, which he reintroduced in November.