World champion Jorge Lorenzo beat Britain's Cal Crutchlow to pole position at the opening MotoGP race of the season in Qatar.
Crutchlow led for much of the session, only for the Spaniard to grab pole with a lap of one minute 54.714 seconds.
Spain's Dani Pedrosa clinched the final place on the front row in the dying seconds of the session.
Briton Bradley Smith took ninth place on his MotoGP debut, with highly-rated Spaniard Marc Marquez in sixth.
Valentino Rossi, who has rejoined the Yamaha Factory Racing team alongside long-time rival Lorenzo after two seasons with Ducati, finished seventh and will line up on the third row of the grid.
Lorenzo claimed the 52nd pole of his career and his seventh at the Losail International Circuit in the new qualifying format, which sees the top 12 riders battle for pole in a 15-minute session.
"It was difficult because Cal is a very explosive rider and can do an extremely quick lap, so I had to put in all of my talent and speed to finally make it," said Lorenzo.
Crutchlow, on the Monster Yamaha Tech 3, finished two tenths behind the world champion after abandoning his final run on turn one and the British rider is expecting a close race on Sunday.
"I think we came into this season in good shape, we have made a bit of a step and I am grateful for the support I am getting and delighted to be up near the front," Crutchlow said.
"I think we did a good job and the team have worked well over the weekend.
"You can expect to see a big battle, I'm sure, because there are seven riders able to challenge at the front and probably seven who are able to win. So it's going to be a close race. Really close."
Honda's Pedrosa denied Italian Ducati rider Andrea Dovizioso a place on the front row, with Germany's Stefan Bradl fifth on the Honda.
Michael Laverty, the third Briton in MotoGP this season, will start from the back of the grid on the PBM-Aprilia.
"It's been tough this weekend," Laverty told BBC Sport. "The first proper laps we've done on this bike in anger so everything's quite new.
"We're a long way behind where we expected to be. We found a little issue on the bike last night and it was like starting all over again."
In the earlier Moto2 qualifying session, Britain's Scott Redding secured fourth behind Spain's Pol Espargaro on pole.
Qatar MotoGP qualifying positions:
1. Jorge Lorenzo (Spain) Yamaha 1:54.714
2. Cal Crutchlow (Britain) Yamaha 1:54.916
3. Dani Pedrosa (Spain) Honda 1:55.151
4. Andrea Dovizioso (Italy) Ducati 1:55.160
5. Stefan Bradl (Germany) Honda 1:55.477
6. Marc Marquez (Spain) Honda 1:55.645
7. Valentino Rossi (Italy) Yamaha 1:55.711
8. Alvaro Bautista (Spain) Honda 1:55.870
9. Bradley Smith (Britain) Yamaha 1:56.315
10. Andrea Iannone (Italy) Ducati 1:56.523