Seven-time MotoGP world champion Valentino Rossi will start Sunday's season-ending Valencia Grand Prix from tenth place on the grid, in the final race of his long career.
Rossi, 42, squeezed into the top 10 as 23-year-old Spanish rider Jorge Martin secured pole position on his Ducati in qualifying on Saturday.
"Beyond all the emotional side, for me it's important to have a good weekend, a good result, and starting in the top 10 is already a good start," said Rossi.
Francesco Bagnaia, Rossi's Italian protege who was denied a sixth straight pole position, will start from second place.
Rossi praised 24-year-old Bagnaia, a graduate of his own VR46 academy and runner-up in the championship, for helping push him into the top 10.
"'Pecco' helped me," said Rossi. "He saw me and he kept pushing. So thank you very much to Pecco for helping me improve my time."
Already-crowned world champion Fabio Quartararo could do no better than eighth place.
The yellow flags of Rossi supporters will dominate on Sunday in what organisers believe will be a 75,000-strong crowd for the Italian's emotional farewell.
- Yellow fever -
It will be Rossi's 432nd Grand Prix in all categories since he began his career in 1996.
As well as his seven premier class titles, he was also world champion in the 125cc and 250cc divisions in his early years.
Rossi is looking to the future by building his legacy at his "VR46 Academy", and his VR46 team will make their debut in MotoGP next year as a Ducati satellite.
He is also planning to try his luck on four wheels in GT Racing, and is soon to become a father as his partner Francesca Novello is expecting a baby girl.
"I can't complain, I have had a very long and successful career. Now I want to enjoy life -- I will be a father next year," Rossi said on Thursday.
After qualifying on Saturday, Rossi showed why he is still a crowd puller.
He bowed to the fans and signed a giant street art fresco that portrayed his smiling face.
A few metres away, in the paddock, the nine motorcycles on which he won all of his titles were lined up.
Quartararo had suffered a fall in Friday practice and his mood did not improve Saturday.
"We are in a bad situation, I don't know if it is the circuit, because two years ago here we were on pole, and now it's more of a nightmare," said the French Yamaha rider.
"I'm not sure what's going on, I'm not satisfied and I would like to know the reason for our poor performance."
Meanwhile, Honda could go into the race without both of their factory riders after Pol Espargaro suffered a huge crash in free practice and missed qualifying.
Espargaro needed treatment at a nearby hospital after his highside crash which saw him stretchered off the track.
Honda team boss Alberto Puig said he had a potential injury to his ribs.
"A blow to the wrist. He has a big bruise on his chest, on his ribs. Apparently, according to the CAT scan, there is no fracture, which is very important," said Puig.
"He will be in tremendous pain and we will see how he comes back. The important thing was to rule out fractures and that's why it was decided that he should go to Valencia for a complete examination."
Honda are already without six-time world champion Marc Marquez who has still to recover fully from last month's off-road training accident which also saw the 28-year-old miss last Sunday's Algarve Grand Prix.