After fulfilling his ambitions in Deccan, Shivaji turned his attention to Mughal territories. He started raiding the territories of Aurangzeb. At that time, the Mughal viceroy of Deccan was Shayista Khan.
He captured the Poona fort and forced Shivaji into the wilderness. Shivaji hit back, injured Shayista Khan and raided his palace. Aurangzeb sent Raja of Amber, Jaisingh to control Shivaji. He compelled Shivaji for a peace treaty according to which Marathas were to give 23 forts to Mughals and Shivaji had to appear in the court of Aurangzeb.
However, he was not shown enough respect in the court of Aurangzeb. When he protested, he was imprisoned. However, Shivaji managed to escape from the jail in disguise.
Shivaji returned to his old ways of guriella wars and started plundering the Mughal territories. He raided Surat in 1671 and defeated the Mughal general Daler Khan in 1674. His coronation was held with all the pomp at Raigarh where he assumed the title of Chhatrapati.
Shivaji also succeeded in levying Chauth wherever he could. In fact, Shivaji organized Marathas into a force which became one of the most Indian powers later on.