Great Britain had not won an Olympic relay gold medal since 1912 ahead of Athens in 2004.
The United States had dominated the men's 4×100 metres relay in the intervening 92 years, winning 15 of the 19 Olympic titles available.
It was an incredible end to a dismal track and field meeting for Britain's male athletes.
It looked as if they would finish without an Olympic medal of any colour for the first time in history.
The men's sprinters had also badly under-performed with no representation in either the 100m or 200m Olympic finals for the first time since 1976.
But that all changed after Britain had almost been disqualified from the semi-final following a poor third baton change.
The Americans seemed unbeatable with 100m champion Justin Gatlin, 200m champion Shawn Crawford and three-time world champion Maurice Greene in their line-up.
Coby Miller, the fourth member of the quartet, had also dipped below 10 seconds in the US trials.
The omens did not seem good as the British four had been hampered by injury and loss of form and Gardener then had a false start in the final.
But Britain, in lane three, had the Americans in their sights two lanes outside them and Gardener and Campbell kept them in touch.
The Americans made a mess of their second baton changeover and Devonish gave Lewis-Francis a narrow lead into the final straight.
Lewis-Francis ran the leg of his life to hold off Greene and win by the thickness of a vest in 38.07 seconds.
The US were one hundredth of a second behind and Nigeria took the bronze.
The victory was especially sweet for Campbell, who had been criticised publicly by American track legend Michael Johnson about the actual seriousness of his injury.
"After what certain people have said about me I did contemplate going home," Campbell said.
"I had a meeting with the guys and said if they wanted me to keep going I would.
"Once they put their faith in me, I had full faith in them. The craziest thing is we knew we were going to win it."