The formal protectorate over Egypt did not long outlast the war. It was brought to an end when the British government issued the Unilateral Declaration of Egyptian Independence on 28 February 1922. Shortly afterwards, Sultan Fuad I declared himself King of Egypt, but the British occupation continued, in accordance with several reserve clauses in the declaration of independence. The situation was normalised in the Anglo-Egyptian treaty of 1936, which granted Britain the right to station troops in Egypt for the defence of the Suez Canal, its link with the Indian Empire. Britain also continued to control the training of the Egyptian Army. During the Second World War (1939–45), Egypt came under attack from Italian Libya on account of the British presence there, although Egypt itself remained neutral until late in the war. After the war Egypt sought to modify the treaty, but it was abrogated in its entirety by an anti-British government in October 1951. After the 1952 coup d'état, the British agreed to withdraw their troops, and by June 1956 had done so. Britain went to war against Egypt over the Suez Canal in late 1956, but with insufficient international support was forced to back down.