In 800, Pope Leo III crowned who

emperor of the Romans as a form of thanks for protection from the pope's enemies.

Charlemagne