Valentino Rossi was prepared to wait until the middle of the year for a new MotoGP deal, before Yamaha put one to him on the eve of the season opener.
Rossi had indicated he was likely to seek a two-year contract extension with Yamaha beyond 2016, but said he would wait "five or six races to decide".
Yamaha tabled contract offers to both of its riders at the start of Qatar Grand Prix week, and Rossi penned his new deal while in Doha, before it was announced on Saturday.
The timing, shaped by team-mate Jorge Lorenzo's goal of having a new deal secured before the first race, brought the 37-year-old's decision forward.
"I thought in my mind to wait some races, I want to see if I am competitive," he said.
"Also because usually it is like this, you decide around June.
"I spoke with Yamaha after the test and they said to me that they are very happy if I continue. In my mind I wanted to continue.
"The contract more or less was already ready.
"They said to me, 'why wait?' and I said, 'I agree', so we did it."
Rossi agreed with the notion that he would finish his MotoGP career with Yamaha, and that the new deal through to 2018 would "90 per cent" be his last.
Yamaha's MotoGP boss Lin Jarvis described Rossi's confirmation as "immediate" when the offer was made.
He shared his rider's outlook beyond 2018, but said that the Italian's decorated career showed that nothing was certain.
"I think his expectation and our expectation is most likely this will be the last contract in MotoGP, I guess," Jarvis said.
"But never say never, as we have learned from his career up until today."
Autosport has produced a standalone special magazine to celebrate our 70th birthday. All current print subscribers will receive a copy for free. To order your copy of the 196-page Autosport 70th Anniversary issue, please go to: autosport.com/autosport70th