A courtesy title given to a man who has made the pilgrimage (hajj) to Mecca; from Arabic. Johnston glosses Alhaji as the 'courtesy title accorded to any man who has made the Pilgrimage to Mecca'.
He was addressed as Alhaji after returning from Mecca.