BUDAPEST, Hungary (AP) — Formula One champion Lewis Hamilton looks ominously quick as he bids to win the Hungarian Grand Prix for a fifth time, topping both practices on Friday while his Mercedes teammate and title rival Nico Rosberg struggled for consistency.

Hamilton will be confident of securing a ninth pole position in 10 races this season when qualifying starts on Saturday.

"I'm starting to think this might be my favorite track," said the British driver, who has a third-place finish here to add to his wins. "It's so fun to drive with the combination of corners and undulations. The way it all flows together just feels old school."

Rosberg has never secured a podium finish on the Hungaroring circuit, however, and the German driver ended the day in pensive mood. After finishing second in the morning session, he dropped to fourth in the afternoon's second run, a distant .719 seconds behind Hamilton.

"It went from oversteer to understeer, a bit difficult to explain, but I was always chasing my tail in a way," said Rosberg, who trails Hamilton by 17 points in the title race.

On an encouraging day for Red Bull, Daniil Kvyat posted the second quickest time ahead of Daniel Ricciardo, who went off the track with smoke billowing from his car with about 20 minutes remaining, bringing out the red flag for the third time on the day.

It came out twice in the morning, first when Mexican driver Sergio Perez emerged unscathed from a crash and when veteran Finnish driver Kimi Raikkonen lost his Ferrari front wing.

On a tricky day for Ferrari, Sebastian Vettel twice lost control of his car in the second session, finishing seventh best.

"We didn't get into the rhythm today," said Vettel, who is 59 points behind Hamilton in third place overall.

Hamilton's second run saw him finish clear of Kvyat by .351 seconds, and Ricciardo, the winner here last year, by .502.

Red Bull's best result this season was at the Monaco GP, where Kvyat finished fourth and Ricciardo fifth.

The tight and sinewy 4.4-kilometer (3-mile) Hungaroring track is similar to Monaco in the sense that overtaking is very difficult, so straight line speed is negated and a strong qualifying result usually ensures a healthy haul of points.

Many drivers wore tributes to Jules Bianchi, with race stickers such as "Ciao Jules" or "JB 17" on their helmets for the driver's initials and car number. Bianchi died last Friday at the age of 25 from injuries sustained last October in a crash at the Japanese GP.

"Jules is on all our minds, and we are all affected," Kvyat said, while Ricciardo added that "it's important to race well for Jules this weekend."

There was a major scare when the red flag came out one hour into P1 as Perez flipped his Force India car on Turn 11, with the rear skidding out from under him and sending him into the barriers, and the car then toppling slowly over. Force India blamed it on a suspension problem.

Fears for Perez's safety were quickly eased as he waved to fans at the Hungaroring on his walk to the medical center for a mandatory check.

"The impact was not that bad but when I rolled over I got a little bit scared," Perez said. "Getting out of the car was quite a challenge, but thank God (nothing) happened and I'm here."

Force India decided not to start either Perez or Nico Hulkenberg in the afternoon because the team was investigating the suspension problem. By the evening they still had not put their finger on what exactly had caused it.

The track temperature was 59 degrees Celsius (138 degrees F), the hottest in F1 in two years, according to Pirelli.

"You're drenched in sweat before you even get in the car with all the thermals on," Hamilton said.

But it hardly made a difference, as the two-time F1 champion needed little time to shoot up the morning leaderboard and then went even faster in the afternoon.