There was joy for Brazil in Moscow, but also schadenfreude at one remove as a 2-0 defeat of Serbia propelled Tite’s improving team into the World Cup knockout stages on the same afternoon Germany left the tournament.

A projected last-16 meeting with Brazil’s nemesis of four years ago can now be safely placed away in the box of horrors. Germany’s defeat by South Korea in Kazan brought great booming cheers around the Spartak Stadium press room and squeals of joy from the Brazil supporters outside.

The five-times champions will instead travel east to Samara to play Mexico as Group E winners. But for all the triumphalism towards the end here, the cheers as the yellow shirts shuttled the ball between some tiring Serbs, there will still be a slight unease around the latest generation to wear that heavy gold shirt.

Switzerland seal place in World Cup last 16 after 2-2 draw with Costa Rica Read more

The team’s emotional state had preoccupied the Brazilian press before this game, the canoeing question at Tite’s press conference centred on exactly what degree of crying was acceptable, what were the official team blubbing guidelines.

There were no tears here, and indeed Brazil played well in phases. They had a majority hold on possession and looked more nimble in attack, when the ball was shuttled effectively between Philippe Coutinho and the front three. Neymar, who it must be remembered is still finding his fitness under the weight of a World Cup, had more touches than anyone else in the game, managed seven shots at goal and might have scored at least a couple had his finishing been at its most severe.

The risible theatrics remain, however. At one point Neymar felt a hand on his shoulder and proceeded to writhe around holding his eye for so long that there was a sudden concern that maybe some invisible skewer flung by a ghostly Russian stadium sprite had indeed penetrated his retina and he was in fact dying before our eyes. But apparently not. He was actually fine.

Coutinho looked in wonderfully good order again and set up the opening goal. He has now scored two and made one of Brazil’s five goals in Russia.

Facebook Twitter Pinterest Paulinho stretches to put Brazil ahead. Photograph: Joosep Martinson/Fifa via Getty Images

But between this there were periods where Brazil looked callow and dinky, lacking in presence in central midfield, where Nemanja Matic and Sergej Milinkovic-Savic were able to dominate the space. Mexico have already exploited a similar central weakness in the defending champions.

The Spartak is a tight ground by the standards of this World Cup, clamped beneath the usual needlessly huge roof, a crown of vast grey tubing swooping around all four sides. Defeat on a muggy night in Moscow would have sent Brazil out at the group stage for the first time since Pelé was kicked around the fields of England, and Serbia through for the first time in their independent history.

Brazil were unchanged. Serbia made three, Milos Veljkovic, Nikola Milenkovic and Adem Ljajic coming in. And they were brusque and powerful in the challenge from the start, looking to pile deep crosses in on Brazil’s undersized full-backs.

Marcelo left the field early on with a muscular injury, replaced by Filipe Luís. And with 24 slow-burn minutes gone Neymar produced his first little moment of grace, jinking around Milinkovic-Savic with a smattering of fairy steps, then combining with Gabriel Jesus to force a shot.

Five minutes later the same combination should have made the opening goal. Neymar whipped a long pass inside Antonio Rukavina. Jesus galloped in on goal and cut inside but saw his right-foot shot blocked.

Brazil’s central three began to snap together with a little more urgency as Ljajic was booked for a trip on Neymar that drew a series of gymnastic rolls down the touchline, combined expertly with stricken shriek and waving arm.

The opening goal was coming. It duly arrived on 36 minutes, product of another divine intervention from Coutinho, who dropped deep and floated a dream of a pass over the top. Paulinho timed his run perfectly and got a toe to the ball as Vladimir Stojkovic rushed out.

Brazil’s players celebrated with a prolonged 10-man huddle. And after the break they should have killed the game early on, Neymar delaying as he ran on to another fine Coutinho pass and allowing Stojkovic to save. For a while Serbia began to assert their midfield strength, helped by the fact Brazil leave that whole area to Casemiro and Paulinho, who were pushed to the fringes at times by the crush of red shirts.

On the hour Alisson fumbled a low cross from the right and saw the ball fall just shirt of Aleksandar Mitrovic. And with 68 minutes gone it was 2-0. Mitrovic tried to cling to Miranda at a corner but only succeeded in falling. Behind him Thiago Silva bulleted his header high into the net.

The World Cup has been crying out for a statement performance from one of the bigger teams. This wasn’t it from Brazil. But they will march on with some confidence, demons vanquished elsewhere, to face opponents who have yet to score against them in four World Cup meetings.

Sign up for The Fiver, our funny and free daily football email.