The United Kingdom is backing investment of more than $300 million in South Africa’s green energy transition as the country struggles to end power shortages that nearly tipped its economy into a recession last year.

The UK’s High Commissioner to South Africa Antony Phillipson said the funding through Globeleq, is part of the UK’s $1.8 billion commitment to finance South Africa’s renewables programme under the country’s Just Energy Transition Partnership. Globeleq is majority owned by British International Investment, the UK’s development finance arm.

“This is a significant investment in South Africa’s future,” Phillipson told CNBC Africa. “This will be the biggest standalone battery energy storage system anywhere in Africa and it will also make, as you say, a really significant contribution, I think, to South Africa’s Just Energy Transition.”

South Africa has suffered power shortages for the past three years, with the economy almost contracting last year. The government projects the shortages should ease later this year into 2025. The UK is part of a group of Western nations that have committed $8.5 billion to help South Africa’s transition from fossil fuelled power to renewables.

Globeleq says the Red Sand project, which is based in the Northern Cape, will be the largest standalone battery energy storage system in Africa. Globeleq already provides some 1,800 MW of energy in South Africa, Mozambique, Kenya, Tanzania, Cote d’Ivoire, Egypt and Cameroon.

The project is expected to take two years to complete.

“Electricity storage is going to be key not only in helping South Africa meet its considerable industrial and domestic demand for energy but also across Africa as more renewable energy projects benefit from the advances our industry has made with battery energy storage solution technology,” Mike Scholey, Globeleq CEO said in a statement.