SAKHIR, BAHRAIN -- Red Bull driver Sergio Perez moved up the leaderboard as the sun went down to lead the third and final day of Formula One testing on Saturday.

It underlined how strong Red Bull looks heading into next weekend's season-opening race on the same Sakhir desert circuit in Bahrain. Defending world champion Max Verstappen led the first test day.

"A very successful end to the test with another day of uninterrupted running," Red Bull head of race engineering Gianpiero Lambiase said. "Checo (Perez) was able to complete a variety of test items, including a chance to get a feel for the car under conditions closer to qualifying and the race."

Mercedes driver Lewis Hamilton was .36 seconds behind Perez in second but the twitchy W14 again experienced problems with balance and traction.

"We're not quite where we want to be but it's a good platform to start from," Hamilton said. "We don't know where we will be next week, but we will stay positive."

Alfa Romeo's Valtteri Bottas was .52 behind Perez in third ahead of Ferrari drivers Charles Leclerc -- who led after the morning session -- and Carlos Sainz Jr. The Ferraris were around .7 seconds off Perez's pace but showed good reliability.

"We finished the test without any issues and completed the full run plan," Leclerc said.

Perez drove all day and completed 133 laps. Bottas racked 131. Only Alex Albon did more than them with 136 laps for Williams, while the seven-time F1 champion Hamilton did 65.

As temperatures cooled under floodlights at the desert track, there was a flurry of time changes.

Hamilton overtook the Ferraris before Perez zoomed to the top and Bottas made a late charge to push the Ferraris down.

Leclerc is one of the most dedicated drivers in F1, and he spent the final minutes on the pit wall scrutinizing time charts and other information with headphones on.

"We will focus on analysing the data, in order to arrive at the first GP of the year as well prepared as possible," said Leclerc, who has won five career races. "I'm looking forward to racing here next week."

AlphaTauri's Yuki Tsunoda was in sixth spot ahead of Haas driver Kevin Magnussen. Mercedes' George Russell, who drove in the morning, was eighth.

With Lance Stroll still sidelined because of a wrist injury in a bicycle accident, Aston Martin again used F2 champion Felipe Drugovich. He was 10th behind teammate Fernando Alonso.

It is uncertain whether Stroll will recover in time to race next weekend, and Alonso offered no indication.

"No news," the two-time F1 champion said. "It's a private matter."

There was a brief red flag minutes into the morning start after some debris was cleared off the track, seemingly from Perez's RB19.

A second red flag came out when Bottas parked up in a run-off area. His teammate Zhou Guanyu topped day two of testing, showing Alfa Romeo's encouraging pace and reliability.

Testing offers a rough guide to a team's speed, with the cars often set up in very different ways or sometimes holding some speed back.

But McLaren CEO Zak Brown said on Friday he felt his team was behind its projected targets.

Brown will hardly have been reassured when Australian driver Oscar Piastri had a big spin on the track, although he recovered quickly. Lando Norris took over in the afternoon but placed only 11th, with Piastri in 16th.

"There's definitely still a fair bit of learning to do," said Piastri, who was cleared to drive for McLaren after a contract dispute with Alpine last year.