It is the first time two men have walked out of the civil registry in their town of Schaffhausen as husband and husband.
Voters approved the "Marriage for All" initiative by a nearly two-thirds majority last September, making Switzerland one of the last countries in Western Europe to legalise same-sex marriage.
"The ceremony was really very important to me because this has been 20 years in the making," said Carnier, who entered into a registered partnership with Leu in 2014 and has been active in a decades-long campaign to recognise gay rights.
Across the country in Geneva, Aline, 46, and Laure, 45, also tied the knot after being together for 21 years. They have a four-year-old son and, like Leu and Carnier, they had previously been in a civil partnership.
"In every sense, this is a new stage (for us)," said Laure, a human resources specialist who like her partner declined to give her family name.
"It was a very moving and much-awaited moment, which sends a strong message to society... to be free to love," said Geneva Mayor Marie Barbey-Chappuis, who attended the ceremony.
Same-sex couples won the right to enter civil partnerships in 2007 and the right to adopt children parented by their partner in 2018.
But they lacked rights granted married heterosexual couples, including access to regular adoption and sperm donations, as well as an easier path to citizenship for foreign spouses.
Same-sex partners now have these options through marriage.
For Leu and Carnier, the change carried emotional and societal weight.
"I think it's important that our marriage is recognised equally and isn't put to the side in a special category," said Leu.
The men plan to cement their marriage with a religious wedding next year.
In June, the council presiding over the Christian Catholic Church of Switzerland to which Carnier belongs voted to bless the marriages of same-sex couples with the same sacraments and rituals as heterosexual weddings.
The couple plans to invite family and friends to their religious ceremonies, including two adult children Leu shares with his ex-wife and a two-and-a-half-year-old granddaughter.
"I'm convinced that if she grows up with three grandfathers, then it will be something very natural for her," Leu said. "The horizons have expanded. One sees there are many different ways to live today."