Juventus booked their place in the knockout stages of the Champions League after a Mario Mandzukic goal was enough to beat Valencia 1-0 in Turin.
In a tense game with few chances and eight yellow cards, Juventus came through on top to retain first place in Group H ahead of Manchester United and ended Valencia's hopes of qualification.
Mandzukic was set up by Cristiano Ronaldo, who beat a defender before delivering a cross for the Croatian striker to score the game's only goal.
The opening half an hour had no clear-cut chances but Valencia duo Jose Gaya and Geoffrey Kondogbia and Juventus midfielder Rodrigo Bentancur all ended the opening period with a booking.
The best chance of the half arrived shortly before the break but a good save by Juventus goalkeeper Wojciech Szczesny denied Mouctar Diakhaby.
Ronaldo could only hit a free-kick straight at goalkeeper Neto early in the second half but the Portugal star played a vital role as the hosts took the lead in the 50th minute.
The former Manchester United and Real Madrid forward evaded his marker with trademark stepovers down the left and delivered a cross that allowed Mandzukic a tap in to open the scoring.
Moments later Valencia thought they had equalised but referee William Collum instead booked Diakhaby, who had turned the ball into the net with his hand.
Ronaldo was left frustrated after he found space from a corner but headed straight at Neto.
Mandzukic and Ronaldo linked up again when the former pulled the ball back for the Croatian, who was unable to find the back of the net for a second time as his effort looped into the hands of Neto.
Valencia could not find an equaliser and Marouane Fellaini's late goal for Manchester United at Old Trafford means the LaLiga club will head into the Europa League, while Juventus require a win in their final group game against eliminated Young Boys to guarantee top spot.