The Knights' reign ended when Napoleon captured Malta on his way to Egypt during the French Revolutionary Wars in 1798. Over the years preceding Napoleon's capture of the islands, the power of the Knights had declined and the Order had become unpopular. Napoleon's fleet arrived in 1798, en route to his expedition of Egypt. As a ruse towards the Knights, Napoleon asked for a safe harbour to resupply his ships, and then turned his guns against his hosts once safely inside Valletta. Grand Master Hompesch capitulated, and Napoleon entered Malta.