The East India Company established its first permanent factory in India in 1612. For the next century and a half the Company functioned primarily as a trading company, establishing trading posts with the permission of the Mughal emperor of India and competing for business with other European trading companies. However, following the decline of the Mughal Empire in 1707 and after the East India Company's victory at the Battle of Plassey in 1757, the Company gradually began to formally administer its expanding dominions. By the mid-19th century, the East India Company had become the paramount political and military power on the subcontinent, its territory held in trust for the British Crown.Company rule in India, however, ended with the Government of India Act 1858 following the events of the Indian rebellion of 1857. British India was thereafter directly ruled by the British Crown as a colonial possession of the United Kingdom, and India was officially known after 1876 as the Empire of India.