The Jamaicans clocked 37.37sec with Japan producing a national record of 37.60sec for silver while Canada ran 37.64 for third. The US and Trinidad and Tobago were both disqualified.
"There you go, I am the greatest," Bolt said after the race.
"I am just relieved. It's happened. I am just happy, proud of myself. It's come true. The pressure is real. I look at it as an accomplishment. I'll stay up late tonight."
There was plenty of controversy in the women's 4x100m relay with the USA winning gold after being initially disqualified in the heats.
Superstar Allyson Felix had dropped the baton in the heat after being bumped by a Brazilian runner but after a protest it was decided the USA could do a re-run by themselves that night.
They produced a time fast enough to make the final - replacing China - and then from lane one in the gold medal race they delivered an extraordinary performance, clocking the second fastest time in history 41.01sec.
Tori Bowie ran brilliantly over the final leg to win gold, keeping Jamaica at bay who clocked 41.36sec for second with Great Britain setting a new national record of 41.77sec for third.