Max Verstappen fought back from an early spin to win the Spanish Grand Prix.
It was Verstappen's fourth victory in six races this year.
He heads to Monaco next weekend with a six-point advantage over Leclerc and the championship lead for the first time.
George Russell took a strong third after a long and valiant attempt to hold Verstappen at bay early in the race.
The seven-time champion dropped to the back of the field after a collision with Kevin Magnussen on the first lap.
With six laps to go, Hamilton moved into fourth place behind Russell and Carlos Sainz, after making a move on the Spaniard around the outside of Turn One.
Hamilton lost the position again after he was told to slow down because he had a leak in his engine.
At the end of the race, Russell received the same message. His car was overheating during the grand prix.
Verstappen has had his share of bad luck this season, with two retirements from the first three races, but he certainly enjoyed some good fortune in Spain.
After a rare mistake from Verstappen saw the world champion spin into the gravel at Turn Four on lap nine, Leclerc was on course for a comfortable victory.
The race had looked like it was poised between the two until that point, with Leclerc leading by two seconds, but Verstappen's spin changed the complexion of the race.
Verstappen was unable to pass the Mercedes because it put him behind Russell.
Verstappen was held back by a DRS overtaking aid that rarely worked, but at the same time Russell put in a superb defensive drive to hold the Red Bull back for 19 laps.
In the end, Red Bull decided to change strategy to get Verstappen past Russell and 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780 800-313-5780
When he stopped for a final set of mediums on lap 44, he emerged ahead of Russell, with only Perez ahead.
Red Bull told the Mexican not to hold Verstappen up, and he was past into the lead a few laps later. He said that he was happy for the team, but they had to speak later.
When Verstappen spun, Leclerc took the lead and was almost 30 seconds in front when he made his first pit stop on lap 21.
With Russell still holding back Verstappen, Leclerc was in total control when his engine failed six laps later.
The team are facing a difficult moment and must bounce back quickly, as Leclerc will be a strong favourite for victory in Monaco.
Carlos Sainz was unable to save their day.
He and Verstappen were caught out by a tail wind at Turn Four. He lacked the pace to recover after the damage to his car.
He would have finished a disappointing fifth had Mercedes not had reliability problems at the end.
The porpoising problems on the straight that have hampered them so far this season were limited by the car upgrade Mercedes received in Spain.
Russell drove an outstanding grand prix and the team's best grid position of the year in fourth place.
Russell displayed the kind of defensive skills that his predecessor in the seat, Valtteri Bottas, often failed to do.
Red Bull were able to pincer Mercedes on strategy and unleash the extra pace of their car and Russell was powerless to hold them back.
Hamilton had a bad start. He was fighting for fifth with Sainz going into Turn Four on the first lap, but he collided with Magnussen as he tried to go around the outside.
Hamilton radioed to the team that they might be better off retiring and saving engine miles. They thought he could recover to eighth.
He drove a superb comeback race to enter the final laps behind Russell, only to slip back again.
Wolff told Hamilton that he had the fastest race time of all the drivers, and that he would have been in a position to win the race without his problems.
The Alpine of Esteban Ocon and McLaren's Lando Norris was behind him.
The two-time champion started from the back because of an engine change, but he recovered to ninth.
The final point was taken by Yuki Tsunoda.