Abu Yusuf lived in Kufa until he was appointed Qadi in Baghdad. It is unclear whether he was appointed by Mahdi, al-Hadi, or Harun al-Rashid. According to one story, Abu Yusuf was able to provide sound advice pertaining to religious law to a government official who rewarded him generously and recommended him to the caliph, Harun al-Rashid. He continued to provide satisfactory legal opinions to the caliph who drew him into his inner circle and eventually appointed him Qadi. While this version of events is probable, it is not necessarily authentic and cannot be independently verified. What is known is that Abu Yusuf became a close acquaintance of Abbasid caliph, Harun al-Rashid, who eventually granted him the title of Grand Qadi, or Qadi 'l-qudat; the first time such a title had been conferred upon someone in Islamic history. While at the time it was meant as an honorific title, the Caliph frequently consulted Abu Yusuf on legal matters and financial policy and even bestowed upon him the ability to appoint other Qadis in the empire. This made the position of Grand Qadi analogous to a modern-day chief justice. Abu Yusuf held the position of Grand Qadi until his death in 182/798CE.