Bolt was trailing for almost the entire race in the biggest showdown in the sport in years. But with gritted teeth, the two-time Olympic champion clawed back into contention and made his giant stride count to win in 9.79 seconds — .01 seconds faster than the American veteran.
"A lot of people counted me out," Bolt said. "So for me to come and win, this is a big deal."
Rising to the occasion as he always does, Bolt put a shockingly bad semifinal heat behind him to recover with a good start in the final. Two lanes to his right, Gatlin was as good as perfect for most of the race, but for seven years now, there is no denying the greatest sprinter in history.
This victory, Bolt's tightest in a major championship after being accustomed to world-record times and winning gold medals by huge margins, was extra special.
"It's No. 1 when it comes to competition," Bolt said.
Pulling even just before of the finish line, Bolt glanced toward Gatlin in Lane 7 and threw his weight forward in a dip of desperation. His yellow-colored Jamaica jersey crossed marginally ahead the red-clad Gatlin for his third world title in the 100.
Bolt kept on powering along in celebration, and when he returned, Gatlin gave him a warm hug. At 33, Gatlin had been unbeaten for two years as Bolt struggled with injury. But on the biggest of occasions, timing was with Bolt again.
"Got nipped at the line by great Usain," Gatlin said.
In a dead heat for third, Trayvon Bromell of the United States and Andre De Grasse of Canada shared bronze in 9.911 seconds.
Soon, the reggae was blaring through the public address system at the Bird's Nest and Bolt was performing his signature Lightning Bolt move.
"I came to add to my legendary status," the Jamaican said.
It could have been so different had Bolt failed to recover from a stumble at the start in the semifinals. Later saying he hit his foot too hard and almost fell, Bolt had as many as seven racers to catch before winning the heat.
The final was even tougher — even with one of Bolt's best starts in years. And this time, it was Gatlin who tripped in the race.
"On the last five meters, I kind of stumbled a bit," said Gatlin, the 2004 Olympic gold medalist in the 100.
Gatlin was aching for another gold medal, reaching his peak form at 33 after serving a four-year doping suspension midway through his career. He lost the tightest finish since the 2003 world championships in Paris.
After becoming a mother last year, there also was plenty of doubt in the heptathlon about Olympic champion Jessica Ennis-Hill.
Three years after the 2012 London Games, Ennis-Hill remains the standout she once was. With three solid performances in the long jump, the javelin and the concluding 800, Ennis-Hill won her second world title, six years after her first.
Runner-up Brianne Theisen-Eaton needed to make up about six seconds in the 800 to win and went out fast to pressure Ennis-Hill with an early burst of speed. But Ennis-Hill kept her within striking distance and swept past the Canadian in the finishing straight.
Ennis-Hill won with 6,669 points, 115 points ahead of Theisen-Eaton. Laura Ikauniece-Admidina of Latvia took bronze with 6,516 points.
In the men's hammer throw, Pawel Fajdeck of Poland retained his world championship title by winning with a best mark of 80.88 meters, beating three-time Asian Games champion Dlishod Nazarov of Tajikistan and another Pole, Wojciech Nowicki.
The host nation again fell short of a gold medal when Miguel Angel Lopez of Spain held off a strong challenge from Wang Zhen to win the 20-kilometer walk.