There was a pope who was a heretic, until he was elected pope, then I think he was imprisoned by the Byzantine empress. His name does not spring to mind.
Silverius?