It was during the reign of al-Jazzar, in 1799, that the French general and future Emperor Napoleon Bonaparte tried to conquer the Damascus governorate.
In February Napoleon and his army arrived from the south, captured Jaffa and massacred 2,000 Turkish prisoners.
They then moved north, captured Haifa and the Jezreel Valley and laid siege to Acre.
Al-Jazzar's troops, refusing to surrender, withstood the siege for one and a half months.
A British naval force under the command of Admiral Sidney Smith came to the town's defense, and an artillery expert from the fleet, Antoine DePhelipoux, redeployed against Napoleon's forces artillery pieces which the British had intercepted from the French at sea.

Farhi played a key role in the city's defense.
As al-Jazzar's adviser and right-hand man, he directly supervised how the battle against the siege was run.
At the culmination of the assault, the besieging forces managed to make a breach in the walls.
After suffering many casualties to open an entry-point, Napoleon's soldiers found, on trying to penetrate the city, that Farhi and DePhelipoux had, in the meantime, built a second wall, several feet deeper within the city where al-Jazzar's garden was.

Discovery of this new construction convinced Napoleon and his men that the probability of their taking the city was minimal.
The siege was raised and Napoleon withdrew to Egypt.

Some hold that a statement attributed to Napoleon during the war, according to which he promised to return the land to the Jews if he were to succeed in his conquest of Palestine (Southern Syria), was meant to capture Farhi’s attention and betray his master by switching his support to the French.
However, Napoleon never showed any particular interest in winning over the Jews of Ottoman Syria during his campaign there, though his account of the military campaign records that a rumour among Syrian Jews had it that after Napoleon took Acre, he would go to Jerusalem and restore Solomon's temple.
It was during the reign of al-Jazzar, in 1799, that the French general and future Emperor Napoleon Bonaparte tried to conquer the Damascus governorate. In February Napoleon and his army arrived from the south, captured Jaffa and massacred 2,000 Turkish prisoners. They then moved north, captured Haifa and the Jezreel Valley and laid siege to Acre. Al-Jazzar's troops, refusing to surrender, withstood the siege for one and a half months. A British naval force under the command of Admiral Sidney Smith came to the town's defense, and an artillery expert from the fleet, Antoine DePhelipoux, redeployed against Napoleon's forces artillery pieces which the British had intercepted from the French at sea.
Farhi played a key role in the city's defense. As al-Jazzar's adviser and right-hand man, he directly supervised how the battle against the siege was run. At the culmination of the assault, the besieging forces managed to make a breach in the walls. After suffering many casualties to open an entry-point, Napoleon's soldiers found, on trying to penetrate the city, that Farhi and DePhelipoux had, in the meantime, built a second wall, several feet deeper within the city where al-Jazzar's garden was.
Discovery of this new construction convinced Napoleon and his men that the probability of their taking the city was minimal. The siege was raised and Napoleon withdrew to Egypt.
Some hold that a statement attributed to Napoleon during the war, according to which he promised to return the land to the Jews if he were to succeed in his conquest of Palestine (Southern Syria), was meant to capture Farhi’s attention and betray his master by switching his support to the French. However, Napoleon never showed any particular interest in winning over the Jews of Ottoman Syria during his campaign there, though his account of the military campaign records that a rumour among Syrian Jews had it that after Napoleon took Acre, he would go to Jerusalem and restore Solomon's temple.
Haim Farhi