Goals in either half from Paulinho and Thiago Silva were enough to send Brazil through, as they set up a last 16 clash against Mexico despite not being at their fluent best. The Serbs ended third in the group on three points, a disappointing campaign for them and their fans in Moscow after a bright opening game win against Costa Rica.
Serbia is in second place with three points and could still top the group with a win over Brazil and a Switzerland draw or loss to last-place Costa Rica.
An injury to Marcelo in the early ten minutes of the game was a blow but the Selacao recovered with Neymar in the tick of affairs.
Brazil took a while to find their stride against a physical Serbian side who briefly rattled their illustrious rivals, but once Paulinho put them ahead after 36 minutes they always looked comfortable and Silva's 68th-minute header settled it.
Brazil then knocked the ball around with all the deft skill and control that the neutrals at Spartak Stadium had come to see but even then Neymar couldn't get the goal he so desperately wanted, firing a bouncing shot over the bar and having a final effort palmed clear by Stojkovic.
Trump calls for deporting illegal immigrants with 'no judges or court cases'
But despite issuing his executive order , Trump has maintained that his "zero tolerance" policy , introduced by Attorney General Jeff Sessions in April, will remain.
Serbia enjoyed their best chance of the match four minutes later - Alisson touching a unsafe cross from the right straight at Aleksandar Mitrovic whose diving header was saved off the line by a defender before deflecting back into the goalkeeper's hands.
Serbia repeatedly struggled to contain Brazil's fleet-footed attack.
Four years ago, Paulinho was part of the Brazil team that was humiliated at home in a 7-1 drubbing by Germany in the semifinals.
Switzerland also advanced after a 2-2 draw with Costa Rica and will next face Sweden on Tuesday in St. Petersburg.
That gave Brazil the breathing space they craved, and they noticeably relaxed with the two-goal cushion as Serbia ran out of ideas and steam.
- Women in Saudi Arabia can now drive as longstanding ban ends
- Novak Djokovic hopes are dashed as Marin Cilic clinches Queen's title
- Prince William kicks off busy day in Israel at Holocaust memorial
- Nigeria's reluctant tactical change paid dividends in Iceland win - Rohr
- Erdogan faces major test as Turks vote for president, parliament
- US Mideast peace plan to be announced soon: Kushner
- Harden wins first career NBA MVP award
- The "nuclear option" of streaming reality: Ask Australia's Optus
- Dele Alli has 'slim chance' of playing against Panama, confirms Southgate
- Suspect arrested in Florida shooting death of rapper XXXTentacion