At the start of a three-day visit to Algeria, President Emmanuel Macron indicated Thursday that France and the North African country should move beyond their “painful” shared history and look to the future.

The trauma of French colonial rule in Algeria and the bitter war for independence that ended it in 1962 has haunted relations between the two countries for decades and played into a diplomatic dispute that erupted last year.

“We have a complex, painful common past. And it has at times prevented us from looking at the future,” Macron said after meeting Algerian President Abdelmadjid Tebboune.

Standing alongside Macron in front of the intricate North African tilework of the palace where they met, Tebboune said, “We hope the visit will open up new perspectives for partnership and cooperation with France.”

Ties with Algeria have become more important for France because the war in Ukraine has increased demand in Europe for North African gas and because migration has been surging across the Mediterranean.

Algeria is meanwhile seeking to capitalize on higher energy prices to lock in European investment.

Macron has long wanted to turn the page with Algeria, and in 2017, he described French actions during the 1954-62 war that killed hundreds of thousands of Algerians as a “crime against humanity.”

That declaration, politically controversial in France, won him popularity in Algeria when he last visited five years ago, and he was celebrated by young Algerians.

Macron will again reach out to Algerian youth on this visit, with scheduled stops focused breakdancing and North African “Rai” pop music. France is home to more than 4 million people of Algerian origin.

However, Macron’s hopes of moving beyond the fraught history of the colonial era have proved premature.

Last year he was quoted as suggesting that Algerian national identity did not exist before French rule, and he reportedly accused Algeria’s leaders of rewriting the history of the independence struggle based on a hatred of France.

The comments provoked a storm in Algeria, where the generation that fought for independence still dominates the ruling elite and where that struggle occupies a central place in national identity.

Algeria withdrew its ambassador for consultations and closed its airspace to French planes, complicating the French military mission in the Sahel.

Before his meeting with Tebboune, Macron visited a monument to Algerians killed in the war, placing a wreath there. He said the two governments would establish a joint committee of historians to study archives of the colonial era.