Harriet Harman, the Minister for Justice, became deputy leader of the Labour Party yesterday and immediately promised to be a champion for women throughout the United Kingdom.

Ms Harman narrowly squeaked past Alan Johnson, the Education Secretary and the bookies' favourite, to succeed John Prescott, and is only the second woman to hold the post. Margaret Beckett, the Foreign Secretary, was deputy to the late John Smith.

Six candidates contested the deputy leadership and it was not until the fifth round that Ms Harman emerged as winner with 50.43% of the vote to Mr Johnson's 49.56%.

Ms Harman, who had been backed by Alistair Darling, the Trade and Industry Secretary, who on Thursday is expected to follow Gordon Brown into the Treasury as Chancellor.

Douglas Alexander, the Transport Minister, who is to be the new election supremo, hailed her success as a sign that Labour Party members wanted politics to change.

With Jack Dromey, her husband and senior official in the new super-union, Unite, looking on from the front row, she said: "During the campaign I heard what you said - and you want action to tackle the shortage of affordable housing, to do as much for youth services as we've done for children under five, to ensure better support for families with older relatives, to guarantee equal treatment in the workplace and action to improve our environment."

Ms Harman, a close ally of Gordon Brown, implicitly criticised the government's modus operandi until now.

"You want our plans to be debated and presented to parliament, not briefed and spun to the media. You want us to acknowledge the anger and division caused by Iraq, and we do," she declared.

Trade leaders congratulated Ms Harman but also remarked on the strong support for back-bench MP Jon Cruddas, who won the first round of voting and finished third overall.

Derek Simpson, joint general secretary of Unite, said: "It is important for the party and the leadership to take note that people want a change of policies to reconnect with ordinary working people."

A spokesman for the TGW section of Unite said: "It is good news that Labour has elected a woman as deputy leader and particularly one with such a strong campaigning record on social issues and who has admitted that the Iraq war was wrong.

"We would also welcome the strong showing for Jon Cruddas which sends a clear message that Labour's core supporters need to be heard loud and clear by the government," he said.

Ms Harman's opponents were magnanimous in defeat.

Hazel Blears, the first candidate to be eliminated, said she was disappointed by her performance but "pleased" that there was a man and a woman at the top of the party.

Mr Johnson predicted that Mr Brown and Ms Harman would make an excellent leadership team. "I said I was the best man for the job, but as in many spheres in life, there was a better woman," he joked.

Mr Cruddas, whose third place finish reflected the huge increase in his profile during the course of the campaign, congratulated Ms Harman, who he said would make a superb deputy.

"She ran a passionate campaign and has inspired Labour members in a quite brilliant way," he said.