BERLIN — The emotional issue of same-sex marriage moved swiftly to the center of Germany’s national election campaign on Tuesday after Chancellor Angela Merkel softened her resistance, saying for the first time that she would allow members of her party to vote as they saw fit on the issue.

Ms. Merkel’s statement came after decisions by her current coalition partners, the Social Democrats — along with two other parties that may be part of her government after elections in September — made their support contingent on backing for same-sex marriage.

The chancellor’s conservative Christian Democratic Union and its Bavarian sister party, the Christian Social Union, which is strongly Roman Catholic, have favored a “family values” approach, but opinion polls increasingly suggest that a clear majority of German voters of all ages are in favor of same-sex marriage.

The chancellor continues to face resistance from her conservative camp — her party’s chief whip in Parliament, Michael Grosse-Brömer, said on Tuesday, “There is no need for an overly hasty decision.”