Cristiano Ronaldo and Gareth Bale had put the visitors in front after Arturo Vidal's first-half penalty but the Spanish striker sealed a share of the spoils
Arturo Vidal had put the hosts in front with a fierce penalty late in the first half, only for Cristiano Ronaldo and Gareth Bale to turn the match around at the hour mark.
However, Llorente's header was enough to seal a share of the spoils in a thriller at Juventus Stadium and keep the Bianconeri's hopes of the next round alive.
The result means Real will qualify for the knockout stages barring a freak set of results, as third-placed Copenhagen are six points behind with a vastly inferior goal difference. Juventus are now bottom of the group, but only one point behind Copenhagen and Galatasaray.
Giorgio Chiellini was suspended for the hosts after being sent off in the return fixture, so Leonardo Bonucci deputised from the start for the home side.
Real named the now familiar front three of Karim Benzema, Ronaldo and Bale, while Raphael Varane partnered Pepe in the centre of defence.
The visitors made the brighter start, but Juventus grew into the game and were twice thwarted by the returning Iker Casillas.
First he made a superb reflex save to beat away Marcelo's inadvertent deflection in the 17th minute, before denying Llorente at point-blank range with his right foot.
However, there was nothing the goalkeeper could do to prevent the opener three minutes before the break as Madrid conceded their fifth penalty in three matches.
Varane was penalised for catching Paul Pogba's trailing leg and the resulting spot-kick was dispatched high into the goal by Vidal.
Real pressed much higher up the pitch in the second half and were rewarded with an equaliser in the 52nd minute.
Martin Caceres' slack backpass was deflected into the path of Benzema and his throughball was collected by Ronaldo, who applied a cool finish beyond Gianluigi Buffon.
Real nearly punished Juventus further four minutes later when Xabi Alonso's thunderous half-volley cannoned back off the crossbar.
After surviving that scare, the hosts nearly retook the lead when Claudio Marchisio was twice denied, first by Casillas and then by Pepe's goal-line block.
Marchisio's misfortune appeared more significant as Real moved in front on the hour mark, Ronaldo collecting Marcelo's pass with a sublime touch and finding Bale, who drove at the Juve defence and found the bottom-right corner with a drilled left-footed shot.
Yet Juventus were back level six minutes later, Caceres atoning for his earlier error with a teasing cross that Llorente stooped low to head home.
The home fans almost had the chance to celebrate a winner, but were once again frustrated by Casillas as he kept out Tevez's long-distance effort.
The result leaves Ancelotti's side on the brink of the last 16, while Juventus face a battle to reach the knockout phase.