By the early 19th century, the Afghan empire was under threat from the Persians in the west and the Sikh Empire in the east. Fateh Khan, leader of the Barakzai tribe, had installed 21 of his brothers in positions of power throughout the empire. After his death, they rebelled and divided up the provinces of the empire between themselves. During this turbulent period, Afghanistan had many temporary rulers until Dost Mohammad Khan declared himself emir in 1823. Punjab and Kashmir were lost to Ranjit Singh, who invaded Khyber Pakhtunkhwa in March 1823 and captured the city of Peshawar at the Battle of Nowshera. In 1837, during the Battle of Jamrud near the Khyber Pass, Akbar Khan and the Afghan army failed to capture the Jamrud Fort from the Sikh Khalsa Army, but killed Sikh Commander Hari Singh Nalwa, thus ending the Afghan-Sikh Wars. By this time the British were advancing from the east and the first major conflict during "the Great Game" was initiated.