Karim Benzema struck Real Madrid's 1,000th and then 1,001st goal in the Champions League on Tuesday but his double also secured a vital 2-1 win over Shakhtar Donetsk.
The brace from the Frenchman has kept the record winners of Europe's elite competition top of Group D on nine points before Moldovan underdogs Sheriff (six) host Inter Milan (four) later.
Shakhtar, bottom on one, are staring at the exit despite Fernando striking a fine equalizer five minutes before the break.
Benzema had opened the scoring in the 14th minute after Vinicius Junior pounced on a defensive error and the young Brazilian also set up the winner just after the hour having combined with compatriot Casemiro.
"It was a tough game against a good team who played well," said Real captain Benzema, who has four goals in four Champions League games this season.
"We suffer together and we win together. We maybe weren't at our best, but we got the job done."
Liverpool can join Juventus and Bayern Munich in the last 16 later with a home draw against Atletico Madrid after AC Milan held Porto 1-1 in Group B.
Luis Diaz gave the Portuguese the advantage in Milan but an own goal from Chancel Mbemba gave the hosts their first point on their return to the competition after a seven-year absence.
Ajax can also reach the knock-out phased from Group C when they visit Borussia Dortmund later while in Group A RB Leipzig host Paris Saint-Germain and Manchester City welcome Club Brugge.