While Bonaparte was preoccupied in the Middle East and then with French politics, the Royal Navy had returned to the Mediterranean in force. British forces had withdrawn from the region in 1796 after France and Spain became allies in the Treaty of San Ildefonso, but Nelson's victory at the Nile had eliminated the French threat, allowing a large scale redeployment in the second half of the year. Malta was besieged, the Ionian Islands were captured by a joint Turkish and Russian force and successive efforts to reach the trapped garrison of Egypt were defeated at sea. Negotiations to return the French troops to Europe collapsed and although Kléber defeated an Ottoman attack at the Battle of Heliopolis on 20 March 1800, he was assassinated in June. As morale fell, the situation in Egypt became increasingly desperate for the French garrison and the British planned an invasion for March 1801. News of British intentions reached France where Bonaparte, who had successfully reorganised the French Army and driven back allied advances in Italy thus bringing the continental war to an end, ordered a squadron from the French Atlantic Fleet, based at Brest, to reinforce the garrison in Egypt.