Only the little town of Parga held out against him on the coast; and in order to obtain this he once more in 1807 entered into an alliance with Napoleon.
The French emperor, however, preferred to keep Parga, as a convenient gate into the Balkan peninsula, and it remained in French occupation until March 1814, when the Pargiots rose against the garrison and handed the fortress over to the British to save it from falling into the hands of Ali, who had bought the town from the French commander, Cozi Nikolo, and was closely investing it.
Ali was angered by the refusal to surrender Parga and justly suspicious of the ambitions which this refusal implied; he could not feel himself secure with the Ionian Islands and the Dalmatian coast in the hands of a power whose plans in the East were notorious, and he was glad enough to avail himself of Napoleon's reverses in 1812 to help to rid himself of so dangerous a neighbor.
Still bent on obtaining Parga, he sent a special mission to London, backed by a letter from Sir Robert Liston, the British ambassador at Constantinople, calling the attention of the government to the pasha's supereminent qualities " and his services against the French.
After some hesitation it was decided to evacuate Parga and hand it over to the Ottoman government, i.e.