BERLIN (Reuters) - Germany’s Social Democratic Party (SPD) is making legalization of gay marriage a condition for its participation in any coalition government after September’s national election, party Secretary General Hubertus Heil said.

By staking out the position, the left-leaning SPD is taking the same stance as the environmentalist Greens, who could be a kingmaker in three potential coalitions after the Sept. 24 election - one of them involving the SPD.

“Whatever the coalition, if the SPD is going to be in the next government, we will implement marriage for all within the first 100 days,” Heil told the newspaper Rheinische Post in comments published on Friday.

Gay marriage is a step up from the civil partnerships Germany has allowed since 2001. It has been resisted by Chancellor Angela Merkel’s conservative Christian Democratic Party (CDU) and their Bavarian allies.

However, a study by Germany’s Federal Anti-Discrimination Agency in January found that 83 percent of Germans supported legal equality for same-sex marriage.

The SPD is a junior partner in a “grand coalition” with Merkel’s conservatives in the incumbent government.

An opinion poll published on Friday put support for Merkel’s conservatives on 39 percent, far ahead of the SPD on 25 percent.