The protesters choked the normally sedate streets of Melbourne, Australia's second biggest city, and cheered union leaders as they urged the crowd to join a general strike in two weeks' time.
It was one of the largest anti-government protests since hundreds of thousands of people marched against Australia's involvement in the Vietnam War in the mid-1960s.
Union power under attack
The confrontation between the government and the Maritime Union of Australia came to a head last month when a private company, Patrick Stevedores, sacked 1,400 dockers, using legislation which the unions say is designed to curb their powers.
The government backed the company, but the Australian High Court this week overturned the sackings and ordered the company to take the men back.
Administrators of the four labour-hire companies that employed them are now trying to carry out the order.
The judgment was a major defeat for Prime Minister John Howard's attempts to break the union's monopoly on waterfront hiring.
Still out of work
But the dockers were left kicking their heels at wharves around the country after a row over security guards prevented them getting back to work.
Union leader John Coombs accused Patrick of inflaming the dispute and breaching a court order by keeping its hired security force on the wharves.
"We are not going to ask our members to go back to work inside a prison camp," Coombs said in a statement. "The dogs and goons have to go."
But Patrick said its managers feared retaliation from the workers, after weeks of wild scenes on picket lines, and insisted a "minimal" security force would remain.