<P> In 1799, Yashwantrao Holkar was crowned King of Holkars, he captured Ujjain . He started campaigning towards the north to expand his empire in that region . Yashwant Rao rebelled against the policies of the Peshwa Baji Rao II . In May 1802, he marched towards Pune the seat of the Peshwa . This gave rise to the Battle of Poona in which the Peshwa was defeated . After the Battle of Poona, the flight of Peshwa left the government of Maratha state in the hands of Yashwantrao Holkar . He appointed Amrutrao as the Peshwa and went to Indore on March 13, 1803 . All except Gaikwad chief of Baroda, who had already accepted British protection by a separate treaty on July 26, 1802, supported the new regime . He made a treaty with the British . Also, Yashwant - Rao successfully resolved the disputes with Scindia and the Peshwa . He tried to unite the Maratha Confederacy but to no avail . In 1802, the British intervened in Baroda to support the heir to the throne against rival claimants and they signed a treaty with the new Maharaja recognising his independence from the Maratha Empire in return for his acknowledgement of British paramountcy . Before the Second Anglo - Maratha War (1803--1805), the Peshwa Baji Rao II signed a similar treaty . The defeat in Battle of Delhi, 1803 during Second Anglo - Maratha War resulted in the loss of the city of Delhi for the Marathas . </P> <P> The Second Anglo - Maratha War represents the military high - water mark of the Marathas who posed the last serious opposition to the formation of the British Raj . The real contest for India was never a single decisive battle for the subcontinent . Rather it turned on a complex social and political struggle for control of the South Asian military economy . The victory in 1803 hinged as much on finance, diplomacy, politics and intelligence as it did on battlefield manoeuvre and war itself . </P> <P> Ultimately, the Third Anglo - Maratha War (1817--1818) resulted in the loss of Maratha independence . It left the British in control of most of India . The Peshwa was exiled to Bithoor (Marat, near Kanpur, Uttar Pradesh) as a pensioner of the British . The Maratha heartland of Desh, including Pune, came under direct British rule, with the exception of the states of Kolhapur and Satara, which retained local Maratha rulers (descendants of Shivaji and Sambhaji II ruled over Kolhapur). The Maratha - ruled states of Gwalior, Indore, and Nagpur all lost territory and came under subordinate alliance with the British Raj as princely states that retained internal sovereignty under British paramountcy . Other small princely states of Maratha knights were retained under the British Raj as well . </P> <P> The Third Anglo - Maratha War was fought by Maratha war lords separately instead of forming a common front and they surrendered one by one . Shinde and the Pashtun Amir Khan were subdued by the use of diplomacy and pressure, which resulted in the Treaty of Gwalior on November 05, 1817 . All other Maratha chiefs like Holkars, Bhonsles and Peshwa gave up arms by 1818 . British historian Percival Spear describes 1818 as a watershed year in the history of India, saying that by the year "the British dominion in India became the British dominion of India". </P>

In which year was the maratha confederacy defeated by british