(CNN) -- Lewis Hamilton only had a few hours to celebrate his third pole position of the season before the news filtered through that he had been relegated to the back of the grid for the Spanish Grand Prix because of a technical breach.
Race stewards said McLaren had not put enough fuel in the Englishman's car and excluded all his qualifying times -- meaning Venezuela's Pastor Maldonado will start on pole for Williams.
Hamilton's dazzling final lap put him 0.578 seconds clear of Maldonado, but his team told him to stop his car on the track as he returned to the pits.
McLaren tried to argue that Hamilton's low fuel was a "force majeure," but their protests fell on deaf ears.
"As the amount of fuel put into the car is under the complete control of the competitor, the stewards cannot accept this as a case of force majeure," said the ruling.
Formula One rules say that at the end of qualifying, drivers must have enough fuel on board to return their cars to the pits and provide at least one liter of fuel.
"We accept that the stewards did not agree with our interpretation of force majeure," a McLaren statement said: "Our aim is now to maximise the points we can score."
McLaren chief Martin Whitmarsh conceded after the qualifying session that Hamilton could be penalized, although he argued that the Englishman's margin of superiority was so great that the low fuel would have made no difference.
"Lewis and his team did a great job so it was a massive margin, by the situation within F1 at the moment, so undoubtedly he deserves to be there," he said.
Hamilton had been in high spirits after what he described as one of his best ever qualifying sessions, but his demotion made it an awful day for McLaren.
Hamilton's teammate Jenson Button will start 10th after failing even to make the top-10 shootout because of handling difficulties.
Spanish eyes will be on Fernando Alonso, who will now start alongside Maldonado on the front row. The Lotus pair of Romain Grosjean and Kimi Raikkonen are on the second row.
Red Bull had a far from perfect day. Mark Webber will start down in 11th after he was told by his team to come back to the pits in the second session believing the Australian had gone quick enough to qualify for the top-10 shootout.
In the end, Webber, last year's pole-sitter in Barcelona, was nudged out.
Double world champion Sebastian Vettel did make it through but didn't push for pole, preferring to save his tires for a race which is expected to be decided by tire strategy.
Michael Schumacher opted to do the same and will start ninth in his Mercedes, just behind Vettel's Red Bull.
"There is nothing is wrong," Vettel said. "We decided to abort the lap to have a free choice of tires for the race. If I had set a lap, we would have to start the race on soft tires.
"We'll see how it goes for tomorrow. We were a bit surprised how much of a step the others could do, but I'm quite confident for race. We always have a good race car. We have a couple of new sets which has proved successful for others in previous races this year."
Button had been quickest in Friday practice but couldn't rediscover that pace a day later.
"I don't know where it went wrong. All day I've struggled with balance," the Englishman said. "I thought we would be reasonably competitive and at least get into Q3 but that's not the case. I haven't changed that much but struggled with the balance."
Maldonado was quickest in Q2 and ended up on the front row for the first time in his career, far outqualifying teammate Bruno Senna who will start 18th.
"We have been working so hard trying to understand these tires and to develop our car around these tires," the Venezuelan said. "We did a very good step forward for this race."
Tire strategy is likely to be the decisive factor at the Circuit de Catalunya. Pirelli's tires have been under scrutiny all week, with former world champions Schumacher and Jackie Stewart saying they are dangerous.
However, Pirelli claim they have only followed orders to help improve racing and make Formula One less predictable, and Vettel is among those to support the Italian company's efforts.
Red Bull team principal Christian Horner believes they could be in good shape for Sunday's race, despite a less than spectacular qualifying session.
"Going into the race with four new sets of tires is an advantage," Horner said. "Mark (Webber) has four sets of new tires and Seb has used one more set effectively so F1 is a strategic game."