German Chancellor Angela Merkel's conservatives won a state election on Sunday in their centre-left rivals' traditional heartland, a stinging blow to the challenger in September's national vote.

The western state of North Rhine-Westphalia is Germany's most populous and has been led by the centre-left Social Democrats for all but five years since 1966.

It is also the home state of Martin Schulz, the Social Democrat seeking to deny Merkel a fourth term in the 24 September election. Schulz was hoping for a boost after two previous state election defeats sapped his party's momentum.

Instead, Merkel's Christian Democratic Union won 33 percent of the vote in the election for the state legislature, with the Social Democrats trailing on 31.2 percent.

Social Democrat governor Hannelore Kraft's coalition lost its majority as her junior governing partners, the Greens, took only 6.4 percent. Conservative challenger Armin Laschet, a deputy leader of Merkel's party, was set to replace Kraft.

“The CDU has won the heartland of the Social Democrats,” said the conservatives' general secretary, Peter Tauber.

“This is a difficult day for the Social Democrats, a difficult day for me personally as well,” Schulz, who wasn't on the ballot Sunday, told supporters in Berlin. “I come from the state in which we took a really stinging defeat today.”

But he urged the party to concentrate now on the national election. He said that “we will sharpen our profile further — we have to as well.”

“We will continue fighting; the result will come on 24 September,” Schulz said.

The Social Democrats' national ratings soared after Schulz, a former European Parliament president, was nominated in January as Merkel's challenger. But defeats in two other state elections since late March punctured the party's euphoria over Schulz's nomination.

The Social Democrats' result in Sunday's election, the last before the national vote, was their worst in North Rhine-Westphalia since World War II. In the state's last election in 2012, the Social Democrats beat the CDU by 39.1 percent to 26.3 percent.

The pro-business Free Democrats won a strong 12.6 percent of the vote Sunday after a campaign headed by their national leader, Christian Lindner. That gave the party, with which Merkel governed Germany from 2009 to 2013, a strong base for its drive to return to the national parliament in September after it was ejected four years ago.

The nationalist Alternative for Germany won 7.4 percent, giving it seats in its 13th state legislature. The opposition Left Party fell just short of the 5 percent needed to win seats.

The result gives the CDU and Free Democrats a very slim majority. If they can't agree on a governing alliance, Laschet could opt for a “grand coalition” of the biggest parties with the Social Democrats.

A “grand coalition” would mirror Merkel's national government, in which the Social Democrats are the junior partners.

After a blaze of publicity earlier this year, Schulz — who chose not to join the government when he returned to Germany in January — has struggled to maintain a high profile. He has focused on addressing perceived economic injustices, but critics have accused him of providing too little detail of his aims.

Kraft told ARD television she had “asked Martin Schulz to let national politics wait until the election was over.”

Asked whether that was smart, she replied: “I said I would take responsibility for that, and I'm doing that this evening.” She resigned as her party's regional leader.

Merkel's conservatives sought to portray Kraft's government as slack on security, and also assailed what they said is regional authorities' poor handling of education and infrastructure projects. The region of 17.9 million, nearly a quarter of Germany's population, includes Cologne, Dusseldorf and the Ruhr industrial area.

Merkel's party seemed keen not to appear too euphoric, insisting that regional issues played the key role.

The iron Frau: Angela Merkel Show all 11 1 /11 The iron Frau: Angela Merkel The iron Frau: Angela Merkel Comeback queen: Angela Merkel at the Bellevue Palace, Berlin in 2007 EPA / WOLFGANG KUMM The iron Frau: Angela Merkel At home in Germany, the press are comparing Merkel to Margaret Thatcher (pictured in 1981), for her tough-talking stance on the Greek debt crisis GETTY IMAGES / REUTERS The iron Frau: Angela Merkel What Cold War? With Vladimir Putin and George W Bush in 2007 at a G8 summit in Germany. She's known to be an entertaining mimic; was she doing her 'Gordon Brown' for them? AFP The iron Frau: Angela Merkel The famous clip that showed George W Bush squeezing her shoulder The iron Frau: Angela Merkel Whispering with Silvio Berlusconi REUTERS The iron Frau: Angela Merkel Make 'em laugh: with Nicolas Sarkozy AFP The iron Frau: Angela Merkel Crowd-pleaser: Merkel's supporters at a 2009 election rally AFP / GETTY IMAGES The iron Frau: Angela Merkel Immortalised in doll form The iron Frau: Angela Merkel With other world leaders at last year's G20 summit AP The iron Frau: Angela Merkel With her husband Joachim Sauer EPA The iron Frau: Angela Merkel Campaigning in 1990 REUTERS

Asked about Germany's government after September her chief of staff, Peter Altmaier, said that “we always have to keep a cool head... we shouldn't talk about coalitions before the harvest is in.”

National polls show the Social Democrats trailing Merkel's conservatives by up to 10 points after drawing level earlier this year.