MotoGP championship leader Andrea Dovizioso topped the first practice session of the Jerez race weekend, leading Marc Marquez by only 0.007s.
Dovizioso snatched the lead late on from Marquez, managing to find laptime in the final sector despite encountering the Aspar Ducati of Alvaro Bautista.
Pol Espargaro, whose new two-year KTM deal was announced on Wednesday, was a superb third, just 0.043s off the pace.
Dovizioso's teammate Jorge Lorenzo led the session at the start, but it was Marquez who had taken control by the end of the opening runs, posting several laps below 1m40s while none of his adversaries had managed a single one.
The reigning champion's best effort, a 1m39.548s, left him half a second clear of nearest rival Cal Crutchlow – but shortly after the session passed halfway, the LCR Honda man matched Marquez's time to the thousandth.
Valentino Rossi then shot up from 10th to first, before Espargaro took over at the top with five minutes left on the clock, courtesy of a 1m39.311s.
But this was quickly surpassed by Marquez and then Dovizioso, the latter recording his effort 30 seconds before the chequered flag fell.
Pramac pair Danilo Petrucci and Jack Miller made it three Ducatis in the top five, the former snatching fourth place at the death.
Rossi did not improve in the final minutes but still wound up the top Yamaha in sixth, ahead of Tech 3 Yamaha rider Johann Zarco and Crutchlow.
The other works Yamaha of Maverick Vinales spent most of the session well outside the top 10, only to find pace late on and take ninth place.
Scott Redding was right behind Vinales as the top Aprilia, capping off a top 10 split by just 0.317s.
Both works Suzukis were outside of the top 10, with Andrea Iannone 11th and Alex Rins only 21st, while reported Suzuki target Lorenzo was classified 15th.
Bradley Smith, in the first session following the news that he will lose his KTM factory ride at the end of the year, was 20th, five tenths and eight places behind the manufacturer's wildcard entrant Mika Kallio.