PITY America’s big businesses. For years their efforts to reduce their carbon footprint were dismissed by environmentalists as “greenwashing”. Now, after months trying to persuade a supposedly pro-business new president, Donald Trump, of the merits of staying in the Paris climate accord, he practically laughed in their faces by withdrawing on June 1st.

Executives fear the exit will do no good to America’s—and by implication their—reputation. Not for nothing have more than 900 American firms and investors, including Amazon, Twitter, Target and Nike, put their names this week to a “We are still in” open letter to the UN. Its signatories pledge to help reduce the country’s carbon emissions by 26% by 2025, in keeping with America’s Paris pledge. That may be quixotic but is a rallying cry nonetheless.

Indeed, some American firms are taking climate change so seriously that they are surprising even former critics. Alongside energy-efficiency measures, the strongest evidence of their commitment is the number of new wind and solar projects that they are helping to build around the world. Companies are using power-purchase agreements (PPAs), in which they sign long-term contracts to buy clean electricity from firms that develop solar and wind farms at agreed prices, instead of buying the bulk of their power from utilities, which can rarely guarantee 100% clean energy to their customers.

Utilities do sign clean-energy PPAs as well. But in 2015, more than half the country’s wind-energy PPAs went to big companies hoping to take advantage of a federal tax credit before it was due to expire. Big business has by now spurred the worldwide development of a cumulative 20 gigawatts (GW) of wind and solar farms (see chart on left). That is four GW more than the entire onshore and offshore wind capacity of Britain.

Last year it was American IT firms such as Amazon and Google that led the way. They use clean energy to power their vast banks of servers (see chart on right). More recently, enthusiasm is extending beyond tech firms to energy-intensive industries, including manufacturers. It is also moving from corporate headquarters to subsidiaries and suppliers, and from developed countries to emerging markets, where the costs of wind and solar energy are falling fastest. Some environmentalists now see businesses as allies, rather than adversaries, in the fight against global warming, and believe they could become strong forces behind the worldwide spread of clean energy. “There used to be rhetoric and little action,” says Marty Spitzer, head of climate and renewable-energy policy in America for the World Wildlife Fund (WWF), a charity. “Now I see fundamental changes.”

Take Anheuser-Busch InBev, for example. The world’s biggest brewer, with brands ranging from Budweiser to Stella Artois to Corona, has a fair share of millennials among its tipplers, and many take environmental issues seriously. Electricity—used as part of the brewing process, for refrigeration, and so on—amounts to up to a tenth of its costs, says Tony Milikin, the firm’s chief sustainability officer. In March it set out to increase the role of renewables in generating power from 7% to 100% by 2025; as much as 85% will come via PPAs. “My generation, as a baby-boomer, looks at clean air and energy as infinite commodities. The generation coming up looks at it totally differently,” he says.

Iberdrola, one of the world’s greenest utilities (see article), is building a 220-megawatt wind farm in a blustery part of Mexico to supply AB InBev’s largest brewery with clean electricity from 2019. That will add a hefty 5% to Mexico’s renewable-energy capacity. The brewer expects other PPAs to follow in Argentina, Brazil, India, South Africa—and possibly China. Mr Milikin says the firm will “heavily negotiate” with its suppliers, such as those producing its aluminium cans and bottles, to encourage them to do likewise.

Other companies are even tougher. Walmart, the world’s largest retailer, in March said it would require its own operations and those along its supply chain to reduce carbon-dioxide emissions by 1bn tonnes (it calls this “Project Gigaton”) by 2030—the equivalent of taking 211m passenger cars off America’s roads for a year. The announcement was welcomed by charities such as the WWF, which are helping Walmart’s suppliers work towards the goal. Apple, maker of the iPhone, said in April that seven of its big global manufacturers have promised to power their Apple-related production with renewable energy by the end of next year. It is helping its suppliers improve energy efficiency, but also hopes to have brought 4GW of renewable power online by 2020, half of it in China.

Some multinationals are clubbing together to do deals. For instance, AkzoNobel, DSM and Philips, a trio of Dutch firms, have teamed up with Google to buy electricity generated from a co-operative-owned wind park in the Netherlands.

The buzz is spreading beyond the corporate stratosphere. Enel Green Power, one of the biggest sellers of PPAs, is close to developing wind energy in Morocco for local cement factories, steel firms and chemical companies, says Antonio Cammisecra, its boss. It will also build a clean-energy plant for a gold-mining project in South Africa. In Britain a startup, Squeaky Clean Energy, is hooking up small and medium-sized businesses with wind and solar farms in what it calls “peer-to-peer electricity”.

Hervé Touati of the Rocky Mountain Institute (RMI), a clean-energy research outfit, believes the biggest incentive for businesses to do PPAs is to meet sustainability goals, which improve their public image and help attract customers, staff and investors. According to the WWF, almost two dozen of America’s biggest firms have committed to becoming 100% renewable in the near future. Consumer-staples firms make the greenest promises. Fossil-fuel producers are, predictably, the laggards.

Economics is also a draw. In America the cost of procuring wind energy directly is almost as cheap as contracting to build a combined-cycle gas power plant, especially when subsidies are included, Mr Touati says. In developing countries, such as India and parts of Latin America and the Middle East, unsubsidised prices at solar and wind auctions have fallen to record lows.

Yet there are also complications with PPAs, which explain why their growth has been more fickle of late. The most straightforward are for renewable plants on a company’s own property, because that saves the cost of grid-based transmission and distribution. But it is rare for a firm to have sufficient spare land in a suitably sunny or windy area.

More complex, and most common, are remote or virtual PPAs, in which a company agrees to buy an amount of wind or solar energy from a distant developer, which feeds it into the grid. The company receives an equivalent amount of energy from a utility, which gets paid as a middleman. Such bespoke transactions can require a bevy of lawyers, which can put off smaller firms.

The long-term nature of such PPAs is also a hindrance, because they lock in a price that can be costly if power prices do fall. Other options include buying renewable-energy certificates as evidence of clean-energy use, or entering into a green contract with a utility. These may not bring the same environmental kudos, however, because they might not lead to new wind and solar farms being built.

On the bright side, says Simon Currie of Norton Rose Fulbright, a law firm, non-profits such as the WWF and RMI are promoting “buyers clubs” that help bring firms together and standardise PPA contracts. They also press for regulatory reform in places such as China and some parts of America, where incumbent utilities block PPAs because they fear being disintermediated.

At a conference in Beijing on June 7th, the International Renewable Energy Agency, a global body, launched a survey of firms to find out how better to promote corporate PPAs in such places. At the same event, Google spoke of the regulatory hurdles it faces in expanding beyond the five countries where it has bought 2.6GW of PPAs since 2010. This month a pro-Republican alliance of big businesses will even press for carbon taxes and other clean-energy measures. With such powerful backing, the growth of renewable energy may one day win over even Mr Trump.