BERLIN — Germany celebrated its first same-sex weddings Sunday, after a new law came into force putting gay and lesbian couples on an equal legal footing with heterosexual couples.

Town halls in Berlin, Hamburg and elsewhere opened their doors to mark the event, made possible by a surprise vote in Parliament three months earlier.

"We're making a single exception to fire a symbolic starter pistol because same-sex marriages are possible from today," said Gordon Holland, a registrar in Berlin's Schoeneberg district.

Holland said it was appropriate for Schoeneberg to hold the first same-sex wedding in the country because it has long been a center of gay life in the German capital.

About 60 guests and an equal number of journalists packed into Schoeneberg town hall's "Golden Room" to witness the marriage of Karl Kreile and his partner of 38 years, Bodo Mende.

Karl Kreile and Bodo Mende, right, kiss each other during their wedding at Schoeneberg district townhall on Oct. 1, 2017 in Berlin. Steffi Loos / Getty Images

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The grooms entered the room to the popular "Wedding March" by 19th-century German composer Felix Mendelssohn, before saying their vows and signing the marriage documents to applause and cheers from the assembled guests.

Kreile, 59, said it was an "incredible honor" to be the first same-sex couple to marry in Germany, noting that he and Mende, 60, had been campaigning for gay rights for decades.

That's it folks: Karl Kreile and Bodo Mende have become the 1st same-sex couple to marry in Germany as #Ehefueralle takes effect Sunday. pic.twitter.com/NCPRWiRorU — Frank Jordans (@wirereporter) October 1, 2017

After cutting the wedding cake — featuring a rainbow flag and the words "marriage for all" — the couple planned to hold a small reception and fly to Vienna later in the week for a five-day honeymoon.

"We had a huge party 15 years ago that can't be topped," said Kreile, referring to the celebration after the couple registered their partnership in 2002.

Germany introduced registered partnerships in 2002, but those gave same-sex couples fewer rights than heterosexual couples who married.

Chancellor Angela Merkel long opposed same-sex marriages, only agreeing to a free vote in Parliament on the matter in June, shortly before national elections.

The bill, which enjoyed strong public support, passed by a wide margin, with 393 lawmakers voting in favor of marriage equality and 226 — including Merkel — voting against.

"This day sends a significant signal, which is that the state's discrimination of lesbians and gays is finished," said Joerg Steinert, who heads the Berlin branch of Germany's lesbian and gay association. "This was long overdue in Germany and so this is a day of great joy."

Karl Kreile, second left, and Bodo Mende, third left, smile during their wedding ceremony at Schoeneberg district townhall on Oct. 1, 2017 in Berlin. Steffi Loos / Getty Images

Some hurdles remain, including the fact that women can't automatically recognize motherhood of a lesbian partner's child, and the software used to record marriages doesn't currently allow for two entries with the same sex.

Still, those attending Sunday's ceremony in Schoeneberg said Germany's decision to allow same-sex marriages — the 23rd country worldwide to do so — was a big step.

"The state has recognized that if two people want to stand by each other then that's a marriage, regardless of their sex," said Ulrich Kessler, a guest who has known couple for more than 20 years.

According to official figures, there were about 43,000 registered partnerships in Germany in 2015, most of which are expected to be converted into marriages in the coming months.