Reuters

WAITING for the perfect wave, surf-riders at Newcastle seem oblivious to the cargo ships just beyond. A dozen are queuing to load coal from the Hunter Valley, one of Australia's biggest coal-mining regions. The black stuff pouring through Newcastle's port is one of Australia's economic linchpins, making it the world's biggest coal-exporter. As Kevin Rudd, the prime minister, tries to push through legislation to deal with global warming, coal is also one of his headaches. Opposition to Mr Rudd's plans is now so entrenched in parliament that he is contemplating calling an early election.

Australia's first coal was mined at Newcastle in 1797, less than a decade after Europeans began to settle. Australians ever since have enjoyed cheap power from this dirty source of carbon-dioxide, the main culprit of global warming. Coal generates about 83% of the country's electricity, and even more in New South Wales, the most populous state. Mr Rudd wants parliament this month to approve a scheme that would change the way Australians use energy, helping to give the country credibility at the global climate conference in Copenhagen in December.

He has saddled Greg Combet, a minister and former union leader, with the task of talking the coal industry into accepting it. The industry complains the scheme's costs will mean countries such as Indonesia will be able to undercut Australia in global coal markets. Mr Combet argues, nonetheless, that Australia's role as one of the world's biggest emitters, thanks largely to its coal-dependence, imposes a responsibility to help persuade developing countries to change their ways, too, and that Australia has to “get stuck into this”. Not everyone agrees.

Mr Rudd led the Labor Party to power in 2007 promising action against climate-change, after the former conservative coalition had largely ignored the issue. He wants a cap-and-trade system, allowing polluters to buy permits to produce carbon dioxide and sell these to others if they cut their own emissions instead. Bowing to cries from business for more time to get ready, Mr Rudd changed the scheme last month. It will now start from mid-2011, a year later than planned. It aims to cut emissions by at least 5% of 2000 levels by 2020, and possibly 25%, depending on global action. A swag of free permits initially will go to big polluting industries, such as concrete, steel and aluminium, but not coal.

A separate A$750m ($600m) handout will help coal adapt, including by capturing methane (a more potent polluter than carbon dioxide) released from coal mines. By 2020 the government wants solar, wind and other renewable sources to generate one-fifth of Australia's power.

The Minerals Council of Australia, an industry lobby, argues that the cost of complying with the emissions scheme means about 24,000 mining industry jobs would disappear by then. It wants auctions for the permits to be introduced in phases, and not started in full, as is now planned, in 2012. Mr Combet firmly rejects a delay.

Mr Rudd's bigger worries lie in parliament. The House of Representatives, the lower house, passed the emissions-trading bill on June 4th. But the Senate, the upper house, where the government lacks a majority, could kill it. Malcolm Turnbull, leader of the main opposition Liberal Party, supports such a scheme. But he wants it delayed to buy him time to placate the powerful global-warming sceptics in his own party. Barnaby Joyce, of the junior opposition National Party, is less ambivalent. He calls Mr Rudd's plans an “employment-termination scheme”. By contrast, Christine Milne, of the Greens, accuses Mr Rudd of “browning the scheme down” to try to win business and opposition support. She and her four Senate colleagues want the 25% cut in emissions as a minimum target, not a maximum one.

Experts have linked recent devastating bushfires in Victoria and floods in Queensland to changing climate patterns. This has affected public opinion. A poll last month for the Climate Institute, a Sydney research body, found that 77% of people worried about climate change; roughly the same share thought the Liberal Party should back the legislation. Mr Rudd is not due to face an election until late 2010. If the Senate overturns his bill later this month, he can reintroduce it after three months, then call an early election if it suffers the same fate again. That would be a big gamble. But having made an attack on global warming a central feature of his first term, it is one he may be willing to risk.