Red Bull's Max Verstappen was the surprise pacesetter ahead of the two Mercedes drivers in second practice for the German Grand Prix.
The Dutchman, whose team are not expected to be able to compete for pole position with Mercedes and Ferrari, pipped Lewis Hamilton by 0.026 seconds.
Hamilton, who made a mistake on his best lap, was 0.225secs clear of title rival Sebastian Vettel.
The Briton's team-mate Valtteri Bottas was also ahead of the German's Ferrari.
"It's very hot, which makes it very demanding and physical in the car," said Hamilton, who trails Vettel by eight points at the top of the drivers' standings.
"The car was feeling good, but it is very close, so there's lots of work to do tonight.
"Both Ferrari and Red Bull were very quick and I think it will be very similar tomorrow and on Sunday. It's going to be a serious challenge and it's not an easy track to get right, so we will have to give it everything."
Verstappen's fastest time meant Red Bull topped both sessions on Friday, after team-mate Daniel Ricciardo set the pace in the morning session from Hamilton by just 0.004secs.
- Ricciardo to start last after engine penalties
- Who will top the podium in Hockenheim?
- How the practice sessions unfolded
Ricciardo, who will start from the back of the grid as a result of penalties for using too many engine parts, was only 13th fastest after a late start to the session and a spin, which meant he did not do a qualifying simulation run like the rest of the drivers.
Red Bull in general had a difficult day, despite setting the pace. Verstappen suffered an engine problem midway through the second session and was not able to complete a race-simulation run, trying the car on heavy fuel.
"I feel like we have a good balance with the car," said Verstappen. "It was a nice surprise to start so competitively here but we have to remember it is only Friday. The others will be quicker for qualifying but certainly a better than expected start.
"We lost a few laps due to a small oil leak this afternoon but this was quickly fixed and I managed to get a few laps in at the end of the session to make sure everything was fine."
Vettel's team-mate Kimi Raikkonen was fifth fastest, ahead of the Haas drivers Romain Grosjean and Kevin Magnussen.
On the long runs, when teams prepare for race conditions, Ferrari appeared to have a small advantage over Mercedes - Vettel was an average of about 0.2secs quicker than Hamilton on both the ultra-soft and the medium tyre, although Bottas and Raikkonen set almost identical averages on their runs on the soft.
Vettel said: "We are missing a little on one-lap performance. I think we can improve.
"I wasn't entirely happy. It was the only shot I had on the ultra-soft but the car is fine and I think we can still gain something. It seems very close."
Sauber's Charles Leclerc, tipped to be promoted to Ferrari at the expense of Raikkonen next year, continued his impressive progress with the eighth-fastest time, 0.4secs and six places ahead of team-mate Marcus Ericsson, and ahead of Renault's Nico Hulkenberg and Force India's Esteban Ocon.
McLaren, having to use Fridays as test sessions because the car is suffering aerodynamic problems on track that the wind tunnel does not show up, had yet another difficult day.
Fernando Alonso ended the day 17th fastest with team-mate Stoffel Vandoorne slowest of all.