Belgium, who suffered only their second competitive defeat since Euro 2016, threatened to overwhelm Switzerland when Thorgan Hazard scored twice in the first 17 minutes, the first from an awful mistake by Nico Elvedi in the second minute.
But the Swiss hit back to lead 3-2 at halftime with a penalty from Ricardo Rodriguez and a brace from Seferovic before Elvedi atoned for his mistake by heading them further in front in the 62nd minute and then Seferovic added a fifth.
The two sides finished level at the top of Group Two in League A -- the top tier -- with nine points and the Swiss qualified on having the better head-to-head record after Belgium's 2-1 win in Brussels.
"I'm very proud of these young players," said Switzerland coach Vladimir Petkovic. "After the second goal, we had to stay calm and not concede a third goal and try to get slowly back into the game."
Needing to win 1-0, 2-1 or otherwise by a two-goal margin, the Swiss -- beaten 1-0 at home by Qatar in a friendly on Wednesday -- made a terrible start to Petkovic's 50th match in charge.
Despite missing several key players including Romelu Lukaku and Kevin de Bruyne, Belgium quickly increased their lead.
Hazard, playing alongside his older brother Eden, collected a pass in midfield, advanced as Elvedi and Rodriguez backed off and fired a low shot past Sommer from the edge of the area.
The contest appeared to be over but Switzerland were handed a lifeline in the 26th minute when Kevin Mbabu went down in a congested goal-line scramble and Rodriguez converted from the spot.
That completely changed the complexion of the game and five minutes later, Rodriguez lofted a high ball into the area towards Xherdan Shaqiri who cushioned a header into the path of Seferovic to score from close range.
Incredibly, Swiss went ahead one minute before the break with a goal that started with a Belgian corner.
The Swiss cleared the ball, broke and found Edimilson Fernandes on the right where he pulled the ball back into the area for Seferovic to sweep the ball past Belgium goalkeeper Thibaut Courtois.
The hosts still needed a another goal and it arrived in the 62nd minute as Shaqiri, who had an outstanding match, curled a low cross into the area and Elvedi made amends for his earlier howler with a glancing header.
An unmarked Seferovic sealed the win by heading in Mbabu's cross with six minutes left.
"We suddenly started to lose duels and gave away a stupid penalty foul. And suddenly the Swiss got hope for more," said Courtois.
"The feeling went into our team, that this cannot go wrong. But this is a high-level competitive match and hopefully not reaching the final four will teach us a lesson for the future." (Writing by Brian Homewood Editing by Christian Radnedge)
(This story has not been edited by Devdiscourse staff and is auto-generated from a syndicated feed.)