Charles sought to bolster his prestige by declaring war on Algeria, nominally a part of the Ottoman Empire, where the governor had caused a diplomatic incident by hitting the French ambassador with a fly-whisk in a fit of pique. Not for the last time, a French sovereign was attempting to shore up his position at home by emulating Napoleon abroad.