Phelps, seventh at the turn, snatched victory by one-hundredth of a second over Serbia's Milorad Cavic, pounding the water in triumph and screaming with delight when he realized the enormity of his achievement.
"I feel a little bit of everything - relief, excitement, everything," Phelps said. "I had to take my goggles off to make sure the '1' was next to my name."
The 23-year-old American phenomenon, who had appeared invincible as he set six world records in winning his first six golds at the Water Cube, displayed the sheer force of his will as he made up a deficit of more than half a second in the final lap to win in 50.58sec with Cavic second in 50.59.
"One-hundredth is the smallest margin of victory in our sport and it's pretty cool, that's all I can say," Phelps said.
Serbian officials thought it was too close.
They protested that Cavic should have shared the gold, but swimming's ruling body FINA reviewed the race and decreed that the one-two finish stood.
"Under our rules, we listened to the protest," said race referee Ben Ekumbo. "I looked at the video footage from Omega and it was very clear the Serbian swimmer had second behind Michael Phelps, one was stroking (Phelps) the other was gliding (Cavic)."
"I guess the timing system says it all," said Phelps, whose own gold was not jeopardized by the protest.
Cavic had challenged Phelps even before the race began.
As the American took up his familiar pre-race stance alongside his block, facing the side of the pool, Cavic stood by his own block and faced him.
The two stood stock still and staring until the starter called them onto the blocks, but at the finish it was Cavic who blinked, missing out on gold in 50.59.
"When I saw the 50.58 and the 50.59 and I saw the '1' next to my name, that's when I sort of let my roar out," Phelps said.
As Cavic reached for the wall, Phelps gambled with one more short stroke.
"I actually thought when I did take that half stroke, I thought I had lost the race right there, but I guess that was the difference in the end," he said.
Australian Andrew Lauterstein was third in 51.12.
It was the only one of Phelps's five individual events in Beijing in which he both started and finished without the world record, which still belongs to fourth-placed compatriot Ian Crocker.
With his seventh gold medal, Phelps matched the record that US swimmer Spitz established with seven victories at the Munich Olympics in 1972, and will have a chance to break the mark when he swims the 4x100m medley relay on Sunday.
"I think the biggest thing is when someone says you can't do something," Phelps said of his determination in pursuing a record once thought unassailable.
"It shows that anything is possible when you put your mind to it."
Phelps has won gold here in the 100m and 200m butterfly, 200m and 400m individual medley, 200m freestyle, 4x100m freestyle relay and 4x200m freestyle relay.
Phelps, who won six gold medals in Athens, had already moved ahead of Spitz on one score here. He surpassed the US swimming icon, along with Games greats Carl Lewis, Paavo Nurmi and Larysa Latynina, who were tied for the Olympic record of nine career gold medals.
With his seventh Beijing triumph Phelps took his career total of Games gold to 13.

Spitz hails Phelps' `epic' 7 gold medals
BEIJING - Mark Spitz had one word for the performance that gave Michael Phelps his seventh gold medal of the Beijing Games and equaled his own Olympic record that had stood for 36 years.
"Epic," Spitz said Saturday morning when reached by The Associated Press in Detroit, where his youngest son was playing in a basketball tournament.
Moments earlier, Phelps came from behind to win the 100-meter butterfly, edging Croatia's Milorad Cavic by a hundredth of a second.
"It goes to show you that not only is this guy the greatest swimmer of all time and the greatest Olympian of all time, he's maybe the greatest athlete of all time," Spitz said. "He's the greatest racer who ever walked the planet."
With the victory, the 23-year-old from Baltimore pulled even with Spitz's seven-gold haul at the 1972 Munich Games. Phelps can break the record in his final race on Sunday, the 400 medley relay.
Spitz sounded almost giddy on the other end of the phone line.
"I'm ecstatic," he said. "I always wondered what my feelings would be. I feel a tremendous load off my back. Somebody told me years ago you judge one's character by the company you keep, and I'm just happy to be in the company of Michael Phelps. That's the bottom line."
"I'm so proud of what he's been able to do," Spitz added. "I did what I did and it was in my day in those set of circumstances. For 36 years it stood as a benchmark. I'm just pleased that somebody was inspired by what I had done. He's entitled to every second of what's occurring to him now."
Spitz said he had considered it a "foregone conclusion" that Phelps would equal his record, especially since he won six golds at the 2004 Athens Olympics.
And now he fully expects Phelps to make it 8-for-8 on Sunday with a win in the relay.
"The Americans have never lost that race since it's been an event in the Olympic Games," Spitz said. "You have to be very cautious on the relay exchanges and make sure nobody gets disqualified, but it should be just a matter of what the time is going to be and who's going to put the gold medal around their neck first."