Germany’s centre-left Social Democrats have elected Andrea Nahles, a combative and outspoken former labour minister, as the first female leader of the 155-year-old party.

Known for her lectern-thumping speeches and occasional outbursts of child-like humour, the 47-year-old single mother joins the country’s chancellor, Angela Merkel, at the top of German politics – and may one day seek her job.

“We’re breaking though the glass ceiling in the SPD,” Nahles said at the delegates’ meeting in the city of Wiesbaden. “And the ceiling will stay open.”

Well-connected within her party, Nahles, a former leader of its Jusos youth wing, won 66% of the vote, beating Simone Lange, 41, a former policewoman and mayor of the city of Flensburg.

The less than stellar result against an outsider reflected lingering resentment within the party toward the decision, which Nahles strongly promoted, of govern as junior partners again to Merkel’s conservatives.

Germany’s finance minister and the SPD’s interim leader, Olaf Scholz, said electing a woman was a sign of long-overdue progress and a historic moment.

In the run-up to the vote, wellwishers had ironically expressed hope that Nahles would do worse than her predecessor Martin Schulz.

A repeat of his 100% party backing last year would have seemed like bad omen given that the SPD won only 20.5% of the vote in the September 2017 general election, the party’s worst result since the second world war.

Nahles now faces the dual challenge of governing responsibly with Merkel while convincing her party’s dwindling number of working-class voters that the SPD is still their champion.

Nahles vowed that the party would fight for social justice and welfare. “Solidarity is what is most lacking in the globalised, neoliberal, turbo-digitalised world,” she said.

She pledged a fight for decent wages as technology destroys traditional jobs, and a pro-EU foreign policy that emphasises pacifism and international cooperation.

From the party’s left, Nahles scored some landmark successes under the previous Merkel coalition government, notably in introducing a minimum wage.

When voters declined to reward the SPD for such gains, the party initially vowed a muscular fight from the opposition benches.

Nahles summed up the party’s combative approach to the Merkel government at the time by telling journalists that “from tomorrow we’ll smack ’em in the face”.

When it turned out that the SPD was likely to rejoin Merkel after all, but drive a tough bargain in the process, she used a kindergarten taunt that loosely translates as “na-na na-na boo-boo”.

It was not out of style for Nahles, who once mocked Merkel’s party in the Bundestag with a slightly off-key rendition of the theme song of Swedish children’s book hero Pippi Longstocking.

Some find such performances grating, but few underestimate Nahles who, like Merkel, is considered a hard worker and a sharp strategist and political operator.