“It couldn’t feel any better,” Johansson said to newspaper Dagens Nyheter after finishing the race with a dramatic closing spurt.
Italian Tatiana Guderzo, who went on to claim the bronze medal, had been leading the race when she was caught up by Johansson, Cooke and two other riders.
Cooke, one of the most successful road racers of modern times, claimed an elusive first major international crown after holding off Johansson and Guderzo with a winning sprint on the uphill finish line of the 126 kilometre race.
She finished in a time of 3 hours 32 minutes 24 seconds to become the first British rider to win gold in an Olympic road race.
Pre-race favourites Marianne Vos of the Netherlands and Germany’s Judith Arndt finished in a group of riders 21 seconds behind, having missed the move which allowed a quintet including Cooke to go on and fight for the gold.
On the final, 9km climb featuring on the second of two laps of a 23.8 kilometre circuit a number of attacks came and went but everyone, including Cooke, was caught napping when Guderzo flew off on her own with 13 kilometres left to race.
On the flat section leading through the one kilometre long tunnel a quartet containing Cooke, Linda Melanie Vilumssen Serup of Denmark, Austria’s Christiane Sauder and Johansson closed the gap.
With the chasing pack only 11 seconds in their wake, the five leaders were far from safe. But behind them a distinct lack of cooperation gave them the advantage they needed.
The teams of Vos and Arndt failed to close the gap, and by the time they arrived at the uphill finish the leading quintet were jostling for position.
Cooke, who has just missed out on world and Olympic titles on past occasions, celebrated wildly after coming across the finish line.
Johansson’s fellow Swedish rider, Susanne Ljunskog, finished the race in 21st place.