Charles Leclerc recovered from a crash early in the day to top the times for Ferrari ahead of Red Bull's Sergio Perez in Friday's second free practice on a day of incidents and accidents at the Azerbaijan Grand Prix.
Leclerc, who has taken pole three times before on the tricky Baku street circuit, had gone off early in opening practice, hitting the barriers at Turn 15 and his car incurring damage to the front right section.
He was unhurt and the Ferrari mechanics fixed the damage although he needed to pit early in second practice to fit a new power steering system.
This produced the odd sight of the Ferrari team forming a wall of bodies – like a team defending a football free-kick – to block vision of Leclerc's car as it was repaired.
He returned to clock a best lap in one minute and 43.484 seconds to outpace Perez, a two-time winner in Baku, by 0.006 seconds with seven-time champion Lewis Hamilton third for Mercedes, 0.066 off the pace.
Carlos Sainz was fourth in the second Ferrari ahead of McLaren's Oscar Piastri and three-time champion and series leader Max Verstappen, who was quickest in opening practice, in the second Red Bull.
His title rival Lando Norris struggled for a clear lap and was only 17th in the second McLaren, his best lap undone when he came upon Pierre Gasly's Alpine and had to abort.
"I'm sorry," said Gasly. "I had a problem with the battery."
Lance Stroll was seventh for Aston Martin ahead of Haas's Nico Hulkenberg and George Russell in the second Mercedes, who had an inter-session engine change.
Behind them in tenth came young Briton Ollie Bearman in the second Haas.
The 19-year-old, who finished seventh on his F1 debut for Ferrari in Saudi Arabia as a replacement for Sainz, is racing in Baku in place of the suspended Kevin Magnussen whose seat he will take full-time next season.
After an overcast opening session, second practice began in warm conditions which continued to cause problems for the drivers.
Leclerc reported steering problems, following an escape road excursion, and Sainz skimmed the barriers while Verstappen slid to a halt at Turn Five to avoid hitting a wall, later complaining about visibility problems with the setting sun.
Russell was detained at Mercedes as the team changed his engine. When he rejoined the session he was soon recalled to the pits due to an unidentified issue.
- 'Tidying things up' -
After six races without a win, Verstappen found a note of optimism when he suggested Red Bull had improved his car to find a more competitive performance in Baku.
The three-time champion and series leader, who is 62 points clear of nearest challenger Norris with eight races and three sprint races remaining, topped opening practice and was then sixth in the second session.
"Overall, I think it's been a good day for us," said Verstappen.
"We learned quite a bit. Now, it's about tidying things up. So far, I feel we have been more competitive this weekend so that's a positive."
The Dutchman has described his car as a 'monster' to drive in recent weeks, but after spending much of the last week working with Perez at the Red Bull team base in Milton Keynes, he was pleased with progress made.
"The track is very slippery," he added. "There's a lot of 90-degree corners so if you have a tiny lock-up sometimes you just hold the brake to avoid hitting the wall.
"For sure, FP2 was more difficult for me, but we just need to get the balance a bit more and then I am confident we can be competitive.”
The team used a revised floor after abandoning an upgrade that was blamed for their recent downturn in form.
"I think we are heading in the right direction,” said Perez. "It's still a long way to go, I think, but it’s promising."