Australia's parliament passed a law on Wednesday that winds back Aboriginal land rights, averting a race-based snap election that could have handed the balance of power to populist politician Pauline Hanson.

To cries of "Shame!" the upper house Senate voted 35-33 to pass Prime Minister John Howard's bill reducing Aborigines' rights to claim access to government pastures leased to farmers.Howard said the law would bury an issue dividing the nation, but angry Aborigines slammed it as a racist land grab and promised an international campaign of protest.

"Indigenous people will not sit back and allow this to happen," Aboriginal leader Aden Ridgeway told reporters.

The law is designed to end confusion over Aboriginal land rights after a 1996 High Court decision allowing native title claims on vast "pastoral leases" around the continent.

It is also meant to give greater commercial certainty to farmers and miners who earn $40 billion a year in exports.

Independent Senator Brian Harradine, whose last-minute change of heart secured the bill's passage, said he had saved Australians from a race-based early election.

"We were heading headlong into a double dissolution divisive election which would have torn the fabric of our society and set race relations back 40 or 50 years," he said, ending 106 hours of debate, the longest in Senate history.

Opposition Labor senators cried out "Shame on you!" - accusing Harradine and Howard of selling out Aborigines - and visitors in the public galleries jeered when the bill passed .