MADRID, Dec 5 (Reuters) - Spanish renewable energy giant Iberdrola and UAE clean energy developer Masdar have formed a 15 billion euro ($16.2 billion) alliance to invest in offshore wind and green hydrogen in countries including Germany, Britain and the United States.

The agreement announced on Tuesday follows a pledge by 118 countries at the COP28 climate summit in Dubai to triple the world's renewable energy capacity by the end of the decade as they seek to wean themselves off fossil fuels.

"Reaching this goal will require immediate action from these governments and the private sector," said Iberdrola Executive Chairman Ignacio Galan.

The first step of the partnership will be for Masdar to take a stake of up to 49% in Iberdrola's 1.4 gigawatt (GW) offshore wind project off Britain's eastern coast, known as East Anglia 3, the Spanish company said.

"With an abundance of wind resources, the UK and Europe are prime markets for Masdar," said Masdar Chief Executive Mohamed Jameel Al Ramahi.

The two companies have previously teamed up to develop an offshore wind farm in German waters in the Baltic Sea and announced separate multibillion-euro investment plans in Britain, the world’s second-largest offshore wind market behind China.

Last week Masdar and Germany's RWE said they would co-develop a 3 GW wind project off the coast of Britain. Masdar's 49% stake in the project is part of its roughly 13 billion euro investment in the country's renewables sector, it said.

Iberdrola has pledged to invest nearly 14 billion euros in Britain through 2028 in grids and renewable projects and is also planning a bid for British power distribution network Electricity North West (ENWL) ($1 = 0.9252 euros)

(Reporting by Pietro Lombardi and Jakub Olesiuk Editing by Kirsten Donovan and David Goodman)