India gained its independence from the United Kingdom on midnight of 15 August 1947 IST, and simultaneously Pakistan was created as a new country as a result of the partition of India.
The Instrument of Accession (IoA) gave only limited powers to the Government of India, only about the three subject matters of Foreign affairs, Defence and Communications.