Real Madrid's Champions League fate is out of their hands after Zinedine Zidane's side succumbed to a 2-0 loss to Shakhthar Donetsk in Ukraine.
Real dominated the first half but were ultimately unable to make the breakthrough, with Anatoliy Trubin denying Karim Benzema before sticking out a palm to parry a Marco Asensio shot that looked like it was destined for the back of the net.
Asensio was arguably the most threatening of the visitors' front line and had beaten Trubin from point-blank range early on, only to see his effort clip the woodwork and go wide.
Shakhtar offered precious little in the first half but came to life after the break. Taison forced a good stop from Thibaut Courtois, but the visitors were then undone by a counter-attack.
Marlos brought the ball forward and fed Matvyenko, whose pass towards the forwards was partially intercepted by Ferland Mendy. Both Mendy and Raphael Varane waited for the other to clear the ball and Dentinho nipped in to fire his side ahead.
The visitors continued to dominate possession but did precious little with it. With minutes left, they were cut open on the break once more, with Manor Solomon dribbling from inside his own half to the Madrid box unchallenged before firing one past Courtois.
The victory sees Shakhtar move up to second in Group B on seven points, level with Real but ahead on their head-to-head record, while Borussia Monchengladbach lead the group with eight points and could qualify with a win over Inter Milan later on Tuesday.