In 1807, Ranjit Singh's forces attacked the Muslim ruled misl of Kasur and, after a month of fierce fighting, defeated the Afghan chief Qutb-ud-Din, thus expanding his empire northwest towards Afghanistan.