(CNN) -- Lionel Messi scored two late goals as Barcelona snatched a dramatic 2-1 Champions League Group C victory at Shakhtar Donetsk.
Lionel Messi's two late goals gave Barcelona a dramatic 2-1 victory in the Ukraine.
The Ukrainian side, who are currently struggling in their domestic league, went ahead on the stroke of half-time when Brazilian Ilsinho broke past two defenders to fire the ball over goalkeeper Victor Valdes.
But Barca scored a controversial equalizer in the 87th minute. The home side put the ball out of play for one of their players to get treatment -- and expected Barcelona to return it back to them.
However, Barca played on and goalkeeper Andriy Pyatov fumbled Bojan Krkic's cross from the left, allowing Messi to prod home from close range.
The Argentine striker, who had come on for Thierry Henry, then won it in the fourth minute of injury time, skilfully stroking the ball home after Xavi Torres had put him through.
It was the second straight game that Messi had rescued Barca in the final minutes. He also gave the Catalans their third straight Spanish league victory on Saturday by converting an injury-time penalty for a 2-1 win at rivals Espanyol.
Barcelona are top of the group with maximum points from their two matches. Shakhtar remain second, ahead of Sporting Lisbon who claimed their first points in the group with a comfortable 2-0 victory over Swiss strugglers Basel.