By late October, the overthrow of the maharaja seemed imminent. He sought military assistance from India, for which he signed an instrument of accession with India. The Pakistan army was pushed back by the Indians but not before taking control of the northwestern part of Kashmir (roughly 40% of Kashmir), which Pakistan still controls, the rest remaining under Indian control except for the portion ceded by Pakistan to China. US aid With the failure of the United States to persuade India to join an anti-communist pact, it turned towards Pakistan, which in contrast with India was prepared to join such an alliance in return of military and economic aid and also to find a potential ally against India. By 1954, the US had decided that Pakistan along with Turkey and Iran would be ideal countries to counter Soviet influence. Therefore, Pakistan and the US signed the Mutual Defense Assistance Agreement and American aid began to flow into Pakistan. This was followed by two more agreements. In 1955, Pakistan joined the South East Asian Treaty Organization (SEATO) and the Baghdad Pact, later renamed the Central Asian Treaty Organization (CENTO) when Iraq withdrew in 1959. Pakistan received over a billion dollars in US military aid between 1954 and 1965. This aid greatly enhanced Pakistan's defence capability as new equipment and weapons were brought into the armed forces, new military bases were created, existing ones were expanded and upgraded, and two new Corps commands were formed. Shahid M Amin, who had served in the Pakistani foreign service, wrote, "It is also a fact, that these pacts did undoubtedly secure very substantial US military and economic assistance for Pakistan in its nascent years and significantly strengthened it in facing India, as seen in the 1965 war." American and British advisers trained Pakistani personnel and the US was allowed to create bases within Pakistan's borders to spy on the Soviet Union. In this period, many future Pakistani presidents and generals went to American and British military academies, which led to the Pakistan army developing along Western models, especially following the British. After Dominion status ended in 1956 with the formation of a Constitution and a declaration of Pakistan as an Islamic Republic, the military took control in 1958 and held power for more than 10 years. During this time, Pakistan had developed close military relations with many Middle Eastern countries to which Pakistan sent military