MONTMELÓ, Spain (AP) — Charles Leclerc was eyeing a perfect weekend in Spain. He dominated practice and qualifying and seemed only an easy Sunday drive away from winning the Spanish Grand Prix.

With only open track ahead, Leclerc was poised to extend his lead in the Formula One standings over reigning world champion Max Verstappen and win his third race of the season.

And then his engine suddenly failed.

As Leclerc’s once blistering Ferrari started to slow, slow, slow, he cried ‘No! No! No!’ over his team radio.

Once the bright Ferrari limped back to the garage, it was done for the day. A desolate Leclerc pulled off his helmet, and his mechanics patted him on the back.

His race was over, and his points lead was gone.

Verstappen is back atop the F1 standings following his third consecutive victory, while Leclerc failed to finish and now trails Verstappen by six points.

“I lost engine power and I had to stop. I don’t know what the problem is yet but it hurts,” Leclerc said. “We showed we were very quick, but we will have to look at this engine problem so it doesn’t happen again this year.”

Ferrari said that Leclerc’s car had suffered an “unidentified” power unit “issue.” The Italian team tweeted that the race outcome was “heartbreaking.”

“The car has performed well, its pace was good,” Ferrari team principal Mattia Binotto said. “We had this problem of reliability that we will have to analyze and resolve, but the season is long and we have a car that is very strong.”

Verstappen’s hat trick of consecutive wins in Imola, Miami and Barcelona helped him erase a 46-point deficit to Leclerc following Leclerc’s win in Australia, his second victory in the first three races of the season.

Ferrari has been better than Red Bull this year at keeping its cars on track; Verstappen’s Red Bull has twice let him down this season and he failed to finish in Bahrain or Australia — both races won by Leclerc.

On Sunday, Verstappen’s chances for a win seemed scuttled after another malfunction. This time it was with his DRS flap, which should open on the straightaways as a driver attempts to make a pass. Verstappen’s had been cantankerous all weekend — the same issue stopped him from challenging Leclerc for the pole in qualifying — and it held him up Sunday as he recovered from a trip off course.

Leclerc’s collapse gave Verstappen the chance to snatch a win that looked sure to escape him. Verstappen led a Red Bull one-two after teammate Sergio Pérez obeyed team orders to let him pass and take the win.

Leclerc had put himself in pole position after ripping off a great final lap in Saturday’s qualifying. His main worry for the race were the high temperatures of 36 Celsius (96 Fahrenheit) that would make the track even harder on tires.

Before the race, he had given his recipe for a win: “good start, good tire management and finish first.”

Two of three proved not enough.

Next weekend the title fight moves to Leclerc’s home race in Monaco with its iconic street circuit in the Mediterranean principality.

“Monaco (next weekend) is important, but so was this race and so is every race,” Leclerc said. “We’re fighting for the championship.”

Ferrari is searching for its first drivers’ title since Kimi Raikkonen won it in 2007.

Leclerc is its best bet in years — if he can get a reliable car.