Following a half marathon win in Johannesburg, he entered the marathon race at the 2003 World Championships in Athletics. Despite it being only his second outing over the distance, he saw off Michael Kosgei Rotich and Julio Rey to forge a lead in the final stages and win the gold medal in a Championship record time of 2:08:31. He continued to focus on road running in 2004, beginning with a run of 59:56 minutes at the Lisbon Half Marathon for fourth place on the downhill course. Next came the London Marathon, where he finished third behind Evans Rutto and Sammy Korir and set a personal best of 2:07:02 despite slipping and banging his head mid-race. He competed at his first Olympics at the 2004 Athens Games but failed to match his previous global form and finished in eleventh place in the men's marathon. A groin injury in the run-up to the competition and Gharib reflected that he had pushed himself too much in training during the two weeks before the race. He repeated his approach to the season in 2005 by starting at the Lisbon Half Marathon and he finished sixth on this occasion. He ran sub-2:08 at the London Marathon for a second time and improved one place from the previous year, finishing as runner-up behind Martin Lel. His focus of the year was a defence of his title at the 2005 World Championships in Athletics. He returned home to Morocco and trained at altitude in the Atlas Mountains region. The move proved fruitful as, in spite of a sleepless night and stomach pains during the competition, he won the world championship marathon with an eleven-second margin over runner-up Christopher Isengwe. This made him only the second runner ever to retain the world marathon title, after Spaniard Abel Antón. With no major competition to work towards in 2006, he focused on competing on the circuit. He finished the London Marathon in a time of 2:08:45 – the third fastest run of his career at that point – but this was only enough for eighth in a fast race which saw him beaten by compatriot Hicham Chatt. After a fourth-place finish at the Great North Run, his next marathon race came at the Fukuoka Marathon in Japan. Gharib came close to a career best, crossing the line in 2:07:19, and took third place on the podium behind Haile Gebrselassie and