The 33-year-old Alshammar clocked 24.14sec, setting a new personal record and landing just outside world record time. She nudged ahead of Dutch swimmers Ranomi Kromowidjojo and Marleen Veldhuis to claim her victory.
Other performances at the world championship meet did not disappoint.
Chinese teenager Sun Yang toppled swimming’s oldest world record Sunday when he shattered Grant Hackett’s 10-year mark in the men’s 1500m, ensuring a rousing finish to the Shanghai-based competitions.
Sun, roared on by a capacity crowd, put on a devastating burst over the last 100 metres as he made up a deficit of more than two seconds to touch in 14min 34.14sec, 0.42sec inside Hackett’s mark set at the 2001 world championships.
America’s Ryan Lochte claimed a superb fifth gold medal, and stuttering Olympic great Michael Phelps enjoyed a successful final night when he helped the United States defend their 4x100m medley title.
British backstroker Liam Tancock secured a second pool gold for next year’s Olympic hosts and American Jessica Hardy, who was serving a drugs ban at the last world championships, won the 50m breaststroke.
But it was the 19-year-old Sun who made the eighth and final evening his own with his historic 1500m triumph, to add to his 800m title and 400m silver won earlier in Shanghai.
“I was not obsessed with the world record before the final, because I wanted to focus on my plan — my goal was to win the gold,” Sun said.
“I’m so grateful to the whole Chinese team, including my coach and my parents as well, and I think the world record belongs to all of them.”
The Zhenjiang native led from start to finish to break the only men’s mark to survive the infamous super-suits era, when muscle-compressing swimwear helped set more than 200 global bests in just two years.
Lochte, the only other record-setter in Shanghai, underlined his current supremacy with his fifth gold medal in the 400m individual medley, matching Phelps’ haul from 2009.
But the 26-year-old insisted he was “not really happy” with his achievement, saying he could still make big improvements before next year’s London Olympics.
“For the most part I’m not really happy. I mean getting five gold medals is definitely great but there were times that I went, I know I can go a lot faster,” he said.
“There’s a lot of places in my races that I messed up on, where I could have changed and would have gone faster but I guess I have a whole another year to make sure I have those perfect swims.
Lochte’s team-mate Hardy showed she is back in business when she won the 50m breaststroke ahead of defending champion Yuliya Efimova of Russia.
Hardy, who missed the 2008 Olympics after a positive test and was serving a one-year ban during the 2009 world championships, timed 30.19sec – outside her world record of 29.80 — with team-mate Rebecca Soni third.
“I am really excited, I’ve trained so hard for that,” Hardy said. “I am really, really glad that I did it. I performed very well. All of us did a good job.”
British world record-holder Tancock defended his 50m backstroke title.
And while Sweden’s Therese Alshammar won the women’s 50m freestyle, American
Elizabeth Beisel, 19, won the 400m individual medley.
And 14-time Olympic champion Phelps was instrumental in the United States’ 4x100m medley win, as he took them from fourth to second in the butterfly leg before Nathan Adrian finished off the win.
Lochte has long played second fiddle to Phelps but he has called the tune in Shanghai, beating his contemporary in the 200m freestyle and 200m individual medley, which he won in world record time.
The 26-year-old also won the 200m backstroke and gave the United States a record fourth straight 4x200m medley world title with a super-fast final leg, after a slow lead-off from Phelps.
Sun leads a youthful Chinese team which secured second place on the medals table with five golds behind the United States on 16, giving them high hopes for next year’s London Olympics.
FINA’s doping control review board chairman Andrew Pipe said there were no positive dope tests during the meet, which was hit by controversy when Brazil’s Cesar Cielo escaped a ban for testing positive for a banned diuretic.