R-3PO was an red protocol droid that was reprogrammed to become a spy droid for the rebel alliance on Hoth. He patrolled Echo Base, looking for any Imperial Droids that had found their way to the rebel base and he either reprogrammed them to serve the rebels, or he destroyed them. He was onboard the first transport to leave Hoth, meaning he survived the Battle of Hoth.