Imran Khan, a cricketer turned politician, served as the 22nd prime minister of Pakistan from August 2018 until April 2022.