“I still wasn’t convinced, it wasn’t the cleanest (lap), but once I heard I got pole I got to relax a little,” added the Australian, who is leaving Red Bull for Renault at the end of the year.
The pole was only the third of Ricciardo’s career and both of those previous ones came in the tight and twisty confines of Monaco.
Verstappen lost out by 0.026, with Ricciardo setting a track record time of one minute 14.759 seconds, and he did not try and hide his disappointment.
“The whole qualifying was crap,” the youngster told the global television audience. “We tried to make the best of it, I thought we had enough but it’s still good to be second.”
Behind the Red Bulls all eyes will be on the title contenders, with Hamilton in the stronger position after a difficult few days for Mercedes.
“I was not expecting to be up as high as we have done,” said the Briton. “The team did a great job yesterday, this was as good as I could get.
“You saw what happened last year with the red car (Ferrari) behind, so it depends how we get away. We will get a good tow from the two in front so hopefully I can gain a position.”
Hamilton won his fourth title in Mexico last year after starting third and then having to fight back from last to ninth following an opening lap collision with Vettel, who had been on pole but lost out to Verstappen.