Daniel Berezowsky and Jaime Chávez Alor, a gay couple from Mexico, recently made history when they got married on November 26, 2018, in New York.

Berezowsky and Chávez are now the first same-sex couple who were legally married outside the country but whose marriage is recognized by the Mexican government, according to The New York Times. The two were married in front of 25 friends and family members by Mexican Consul General Diego Gómez Pickering in Gómez’s residence in the Upper East Side.

The couple first applied for a marriage license in May at the General Consulate of Mexico in New York but were rejected because Mexico doesn’t recognize same-sex weddings at the federal level, only in some of the country’s states and in Mexico City, the capital. They would have needed to travel back to Mexico City or one of the states where same-sex marriage is legal to get married.

They challenged the denial and on October 19, 2018, the court ruled in their favor and the federal government of Mexico granted the couple a marriage license. This ruling also makes it possible for Mexican same-sex couples living abroad to get married in embassies and consulates under Mexican law.

“It felt like after months and months of getting so many noes and rejections, we were finally able to do what should have taken a week to get done,” Berezowsky told The New York Times. “Needless to say, we were both thrilled with the ruling.”

Berezowsky and Chávez met in high school in Mexico City in 2006 and started dating in 2012 after reconnecting on Facebook. They moved to the United States in 2016 to pursue master’s degrees at Columbia University. Berezowsky works as a human rights specialist and communications strategist at Shift and Chávez is a lawyer with Vance Center.

“In his capacity as justice of the peace, the Mexican Consul General in New York, Ambassador Diego Gómez Pickering, joined the happy couple,” said the consulate in a press release. “He wished them success in their new stage (in life) while highlighting the relevance of the event, which paves the way for Mexican couples of the same sex who wish to legally join in marriage at an embassy or consulate of our country.”

The New York Mayor’s Office for International Affairs also congratulated the couple on Facebook, saying, “Their persistence will make a meaningful difference for LGBT Mexican immigrants and their families living in New York City and elsewhere.”