Real Madrid rediscovered their scoring touch against Shakhtar Donetsk on Wednesday but a fine attacking performance was nearly spoiled by lingering problems in defence that almost saw them throw away a four-goal lead.
Real needed a positive display in the Champions League Group A clash in Lviv after Saturday's 4-0 drubbing at home to arch rivals Barcelona in La Liga and forwards Cristiano Ronaldo and Gareth Bale in particular looked sharp and hungry again after underperforming in recent weeks.
Real romped into a 4-0 lead by the 70th minute thanks to a Ronaldo double either side of goals from Luka Modric and Dani Carvajal before Shakhtar roared back to make it 4-3 but Real, who had already qualified for the last 16, held on to secure top spot in the section.
Coach Rafa Benitez made a host of changes from the side humiliated at the Bernabeu, with striker Karim Benzema, midfielders Toni Kroos and James Rodriguez, goalkeeper Keylor Navas and fullback Danilo relegated to the bench.
Under severe pressure only three months into his debut season, Benitez was full of praise for the likes of Isco, Casemiro, Mateo Kovacic and Nacho who were deployed from the start.
However, the former Valencia, Liverpool, Inter Milan, Chelsea and Napoli manager acknowledged there was much room for improvement at the back after Shakhtar rattled in three goals in 11 minutes in the closing stages.
"We dominated all areas of the game until we made the mistake with the penalty and then they quickly got a second which lifted their confidence," Benitez told reporters.
"I want to focus on the positive and of course we will analyse where we went wrong," he added.
"I don't want to forget that the team is first (in the group) and won away from home in the Champions League with four goals.
"Reacting the way the team reacted after the Barcelona game and going 4-0 up is important.
"I am coming away with a very positive feeling. There was a lot of commitment and great work from all the players."
Real have a chance to get their La Liga season back on track when they play at modest Basque side Eibar on Sunday.
The defeat to Barca left the world's richest club by income in third place after 12 matches, two points behind second-placed Atletico Madrid and six adrift of the champions.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)