 In 1809, the British sent an emissary to the court of Shah Shujah in Peshawar, marking the first diplomatic meeting between the British and Afghans.His half-brother Mahmud Shah then allied himself with the "Barakzai" Pashtuns, and captured Peshawar once again and reigned until the Battle of Nowshera in March 1823.Ranjit Singh invaded Peshawar in 1818 but soon lost it to the Afghans.