The atmosphere on Wimbledon's Centre Court at just after 4 o'clock on Sunday afternoon was part hysteria, part disbelief. Roger Federer, the greatest player ever to grace the game of tennis, had just been demolished 6-2 6-1 6-4 in a shade under two hours by Andy Murray, who produced a performance of breathtaking power and passion to win the gold medal.

Murray looked as stunned as everyone else when he produced a succession of aces to close out the match. Instead of sinking to the floor or leaping the net in the traditional manner, he just stood there. Then, after a few seconds, the realisation dawned - he had just annihilated his old nemesis and was Britain's first Olympic men's singles champion since Josiah Ritchie in 1908. Odd how 1908 is becoming the touchstone for so much at these Olympics.

As Federer left the court - can he ever have suffered such a humiliation? - Murray, emulating Pat Cash when he became Wimbledon champion in 1987, scaled the stands to make his way into the box reserved for friends and family, where he embraced girlfriend, father, coaches and, finally, his mother, the indomitable Judy, who tempered the metal from which the gold was made. The ultimate alchemist.

Last month, when he lost to Federer in the Wimbledon final, Murray blubbed, feeling he'd let down the hopes of a nation. This time he was completely in control - both during the match, in which he showed unrelenting concentration, and during the medal ceremony that followed. As he left the court with the gold round his neck, his final gesture was to shake the hand of a small boy at the side of the court. Don't wash that hand, son. Someday it will be worth a fortune on eBay.

Afterwards, he said he had been inspired by both the crowd and the performances of his fellow athletes in Team GB. "I watched the athletics last night, and it gave me a boost coming into today. The momentum the team's had the last couple of days has been so good."

He said he was surprised to have won gold. "I didn't expect that at the start of the week. I had a chance of going deep into the tournament, but I was a little bit tired after Wimbledon, and playing the mixed as well. But I felt so fresh. On the court today I didn't really feel nervous at all, apart from at the beginning of the match. I've had a lot of tough losses in my career, and this is the best way to come back. I'll never forget it."

Bliss was it in that dawn to be alive, but to be a union jack umbrella seller was very heaven. It bucketed down all morning at Wimbledon. But the rain relented just in time for the patriotic decision to be made to open the roof - all the pundits reckoned Murray's best chance was en plein air. Every cloud had a golden lining.

Murray, who has never won a Grand Slam, had made it clear all week that this meant just as much as one of the big four titles. He was relishing playing for his country, and the crowd on centre court drove him on. When he broke Federer's serve early in the first set, the noise was enough to lift the roof - had it been on. The brutal forehand that secured the opening point of the next game produced another eruption. Federer had a few supporters in the crowd, but they were overwhelmed. The greatest player of all time was being swept away by a passionate Scot and his 15,000 acolytes.

It was not always thus. "I didn't used to like him - he was no Tim," said Sian Jenkins, who had taken up residence with a group of friends on Murray Mount (formerly Henman Hill). "I started liking him when he showed some emotion after losing to Federer in the Wimbledon final. He really cares. You can see how much it means to him."

Murray Mount was a sea of union flags, and there was hardly a saltire in sight - this has been a tricky week for Alex Salmond, with a vibrant new Britishness born before our eyes. The only St Andrew's crosses visible were painted on the faces of a family who had travelled down from Edinburgh, and even they were sitting on a large union flag.

The Olympics at Wimbledon is subtly different from the annual championship. It's not just that Adele is blasting out on the concourse, white towels have replaced the Wimbledon-branded ones, and the posh stewards with purple arm bands have given way to policemen with machine guns. There is a different atmosphere; a more full-throated patriotism. For one week, the All-England club has become the All-British club, though chants of "Team GB, Team GB" still sound odd. This is Wimbledon, after all, not Wyoming.

The second set turned on a monumental 15-minute game, when Federer - who was 2-0 down - tried to turn the screw on Murray. In the Wimbledon final, Murray had taken an early advantage and then been hauled back, but here he was indomitable, matching everything Federer could throw at him and saving six break points. "We still love you, Roger," said one wag in the crowd - the low quality of waggishness is one thing which never changes at Wimbledon. Federer, seven times the champion here, can't often have been patronised.

Federer's small band of fans refused to bow to what seemed inevitable. "C'mon Roger," screamed one large British woman after every game. The Federer recusants - Brits who refused to toe the patriotic line - were an interesting bunch. "He plays beautiful tennis," said a woman in red Federer ear-rings standing in the forlorn queue for return tickets before the match. "And I don't like all the swearing on the court from Murray - it's just not necessary."

On this occasion, it certainly wasn't necessary, and the undoubted beauty of Federer's groundstrokes counted for nothing. Everything Murray did was determined, decisive; he even snatched his towel decisively from a ballboy at the end of each game. This was his moment. Denied a grand slam - he has lost four grand slam finals, three of them to Federer - this was his chance at sporting immortality.

Usually, in so one-sided a final, support would at some point switch to the underdog, but not this time. The scream that greeted the break of the Federer serve in the fifth game of the third set was visceral. Now, everyone believed Murray would win, and centre court was a sea of red, white and blue, save for one confused young man in the front row who was waving a Brazilian flag. Even the large lady had stopped shouting "C'mon, Roger".

Murray was talking to himself perpetually, urging himself on; he had his foot on Federer's throat and didn't intend to release it. All he had to do now was hold his serve, which he did it with a string of aces that left Federer flailing. "Andy had a clear plan," said Federer later, "and never looked like he was doubting himself." He need never doubt himself again.