Fernando Torres came off the bench to head a stoppage-time winner as Liverpool twice came from behind to beat Portsmouth 3-2 on Saturday.