In the medieval Arabic sources the word "Ghana" can refer to a royal title, the name of a capital city or a kingdom. The earliest reference to Ghana as a town is by al-Khuwarizmi who died in around 846 AD. Two centuries later a detailed description of the town is provided by al-Bakri in his "Book of Routes and Realms" which he completed in around 1068. Al-Bakri never visited the region but obtained his information from earlier writers and from informants that he met in his native Spain: