Third-last going into the final lap and fifth into the home straight, Semenya chased down the front-runners, but had to dip on the line to nudge British favourite Laura Muir off the podium by seven-hundredths of a second.
Kenya’s Faith Kipyegon, the Olympic 1500m champion, won in 4min 02.59sec ahead of American Jennifer Simpson (4:02.76).
Semenya, who fell to the ground after losing her balance in the battle for the line, clocked 4:02.90.
Sifan Hassan of the Netherlands, the fastest in the world this year, died in the sprint for the line, fading to fifth in 4:03.34.
Muir took the early lead from the start, setting a slow pace that probably helped the South African.
But when Hassan and Kipyegon attacked just after midway, Semenya slipped to near the back before producing fireworks almost reminiscent of her performance here at the 2012 London Olympics.
Then, Semenya came from the back of the field in the 800m to take the silver, which is set to be upgraded to gold following the disqualification for doping of champion Mariya Savinova of Russia.
Semenya will compete again here on Thursday, in the 800m heats.
Earlier, Wayde van Niekerk ran as smooth as silk to advance past the 200m heats, reaching the halfway mark of his double attempt.
Friend Akani Simbine, managing his hip impingement, also went through, but matric pupil Clarence Munyai, after thinking he had joined his more famous teammates in the semifinals, was disqualified for a lane violation.
Wenda Nel qualified from the women’s 400m hurdles heats, finishing second in 55.49sec.
Van Niekerk was slow out the blocks but then picked up his pace around the bend to take the lead into the home straight ahead of Briton Daniel Talbot.
The Olympic champion, who attempts to defend his 400m world title tonight, eased off to allow Talbot to cross the line with him, both clocking 20.16.
For Van Niekerk, it’s three races down and three to go.
He has been through the 400m heats and semifinals and now the 200m preliminaries; he faces the 400m final tonight and the 200m semifinals and final over the next two nights.
Simbine secured his spot in the 200m semifinals tomorrow(WED) night by finishing second in his race behind America Isiah Young, clocking 20.26.
“It’s holding up,” said Simbine, who finished fifth in the 100m despite his hip woes. “I get treatment every day. We’re managing it right now so it’s getting there.”
He insisted he was looking to enjoy himself rather than being hellbent on trying to share the podium with Van Niekerk, as he had stated last week.
“Let’s just hope and see what happens. I’m really hoping just to get through each round and finish off healthy. That’s the most important part,” said Simbine, a semifinalist of this event at the last world championships in Beijing two years ago.
“The 200m for me is the more enjoyable race because I don’t have too much pressure as the 100m,” added Simbine.
“I decided let me just run and see what happens. I don’t put so much expectations on myself. I said to my body ‘let’s go and run and see what we can put out’.”
But poor Munyai, third in his heat, spoke to journalists afterwards thinking he had qualified with a 20.19 effort that nearly matched his 20.10 personal best.
He spoke about chasing a spot in the final alongside Van Niekerk and Simbine, but soon afterwards a DQ was placed alongside his name, crushing his dream.
There were some big-name casualties in the 200m, like Isaac Makwala, the Botswana star who was the quickest over this distance this year ahead of Van Niekerk.
He failed to start the race, and there was speculation he may have fallen victim to the food poisoning that hit members of the German team.
Jamaican Warren Weir and Alonso Edwards of Panama both failed to go through, clocking 20.60 and 20.61 respectively.