Ranjit Singh's fame grew in 1797, at age 17, when the Afghan Muslim ruler Shah Zaman, of the Ahmad Shah Abdali dynasty, attempted to annex Panjab region into his control through his general Shahanchi Khan and 12,000 soldiers.