The subcontinent gained independence from the United Kingdom in 1947, after the British provinces were partitioned into the dominions of India and Pakistan and the princely states all acceded to one of the new states.