A tudun was a governor resident in a town or other settlement in the ancient Bulgar, Avar or Gokturk empires, particularly those of the Bulgars and the Khazars[citation needed]. The tudun was the personal representative of the imperial government and could function both as an administrator and a diplomat. At times, a tudun would be appointed for a town nominally under another power's control but de facto within the sphere of influence of the tudun's khagan.[citation needed]