File Photo: European Commission deputy head Frans Timmermans. Photo courtesy of Council of the European Union.
The sun-baked North African country is seeking to offer alternatives for European nations trying to wean themselves off fossil fuels, whose prices have soared following Russia's invasion of Ukraine.
Tuesday's deal, signed by European Commission deputy head Frans Timmermans and Moroccan chief diplomat Nasser Bourita, is the first of its kind, Timmermans said at the signing ceremony in Rabat.
It aims to create "sustainable growth that reflects today's challenges", he added.
Bourita said that the "harsh international reality has shown, both in Europe and in North Africa, that when it comes to energy, it is reliability and only reliability that counts".
The remarks, an allusion to Russia's move to cut off gas supplies to Europe in suspected retaliation for Western sanctions, also come after neighbouring Algeria halted gas deliveries to Spain via a pipeline running across Moroccan territory.
A diplomatic spat with Rabat coincided with the end of a long-running supply contract.
The memorandum of understanding signed on Tuesday is set to boost cooperation on energy and the fight against climate change, with private sector involvement.
"It aims to foster the transition to a decarbonised industry through investment in green technology, renewable energy production, sustainable mobility and clean production in industry," it reads.
In 2009, Morocco adopted an energy strategy aimed at increasing the share of renewables in electricity production to over 52 percent of the country's energy mix -- up from around a fifth today.
With a coastline just 15 kilometres (10 miles) from mainland Spain, the country is the EU's main trading partner on the African continent.