Napoleon Bonaparte's bloody campaign in Egypt and Palestine, which marked the start of modern European colonialism in the Middle East, remains contentious two centuries after the French emperor's death.
The Corsican general set sail eastwards with 300 ships in 1798, aiming to conquer Egypt and block a crucial route between Britain and its colonial territories in India.
It was an occupation that was to leave thousands dead in Egypt and Palestine.
But Bonaparte also brought some 160 scholars and engineers, who produced mountains of research that would play a key role in transforming Egypt into a modern state.
For Egyptian writer Mohamed Salmawy, speaking ahead of the May 5 bicentenary of Napoleon's death, the venture was a mix of "fire and light".
"It was a military campaign, for sure, and Egyptians put up resistance to French forces. But it was also the start of an era of intellectual progress," he said.
The "Description de l'Egypte" resulting from the mission was an encyclopaedic account of Egypt's society, history, fauna and flora.
French troops' discovery of the Rosetta Stone also allowed hieroglyphs to be deciphered for the first time, opening up the field of Egyptology.
Ruler Mohamed Ali drew heavily on Napoleonic research as he built the modern Egyptian state, says French-Egyptian writer Robert Sole.
But Arab nationalist Gamal Abdel Nasser, who helped topple Mohamed Ali's dynasty in 1952, used the episode to promote an anti-colonial national identity.
For historian Al-Hussein Hassan Hammad, at Cairo's Al-Azhar University, Napoleon's scientists were, like his troops, on an imperial mission "to serve the French presence in Egypt... and exploit its wealth."
When Bonaparte's fleet anchored in 1798 close to Alexandria, he ordered soldiers to daub walls with the message: "Egyptians, you will be told that I am coming to destroy your religion: it is a lie, do not believe it!"
But his claims of religious tolerance soon gave way to repression after he toppled the centuries-old Mamluk dynasty in July 1798.
When Egyptians revolted against their occupiers that October, French troops brutally crushed the uprising.
They killed thousands and even bombed the Al-Azhar mosque, a key authority for Sunni Muslims worldwide.
Many Egyptians today see the episode as "the first imperialist aggression of the modern age against the Muslim Orient", Sole said.
That sentiment is echoed in the neighbouring Gaza Strip.
Napoleon seized the ancient port city with little resistance in February 1799, having marched through the Sinai desert after British admiral Horatio Nelson destroyed his fleet.
"He is a small man who has caused great chaos in this region," said Ghassan Wisha, head of history at the Islamic University of Gaza.
"Napoleon came here not only with soldiers but also with scientists and agricultural specialists. But he used science to justify the occupation. He lied."
'Dark, negative image'
Rashad al-Madani, a retired Gaza history lecturer, said the city had been "a centre for honey, oil and agriculture, and a strategic point between Asia and Europe".
Napoleon wrote that Gaza's hills, covered with "forests of olive trees", reminded him of Languedoc in southern France.
Two centuries on, those groves have given way to a forest of concrete.
Gaza is home to two million Palestinians, many of them refugees, ruled by Islamist movement Hamas and strangled by an Israeli blockade.
Madani would remind his students of Napoleon's massacre of some 3,000 people in the port town of Jaffa further up the coast.
"The French occupation was worse than that of Israel," he said.
Small reminders of Napoleon remain in Gaza.
The Qasr al-Basha, the Pasha's Palace where the emperor-to-be reportedly stayed, still stands.
It is a modest sandstone edifice surrounded by scruffy concrete buildings and electric wires.
The palace, first built in the 13th century, had long born Napoleon's name.
But tellingly, after Islamist movement Hamas seized power in Gaza in 2007, it changed the name.
The palace has become a museum, and the first-floor bedroom where the general stayed, unfurnished today, is filled with Byzantine artefacts.
"The population of Gaza today has a dark, negative image of all military campaigns, including that of Napoleon," said Wisha.
It was in Acre, a sleepy port town further north, that Palestinians found a local hero in the struggle against Napoleon.
Ahmad al-Jazzar is still admired by many for holding out for two months against a crushing French siege.
"In our history books, Ahmad al-Jazzar is seen as a strong character, a hero," said Madani.
But Jazzar -- Arabic for "butcher" -- was also "a cruel being, an aggressor," he said.
"Many students didn't like it when I told them that."
And the Arab leader's French rival sparks similar strong reactions.
Marianne Khoury, the executive producer of Egyptian Youssef Chahine's film Adieu Bonaparte, said Napoleon's campaign was still "excessively controversial".
For many in France, the 1985 film was "unacceptable", she said.
"How could Chahine as an Arab director dare to talk about Bonaparte?"
Some Egyptians, for their part, recognise the scientific progress the French invasion brought.
"But the same time, there is the colonial aspect, which is still sensitive, and many Egyptians don't accept it," she said.
© Agence France-Presse