The frenetic home fans packed into Rio’s Maracana stadium on Saturday held their collective breath as Brazil captain Neymar walked up to take his side’s fifth kick in a shoot-out to decide the Olympic men’s soccer final.

Both teams had converted their first four kicks but after Nils Petersen missed Germany’s fifth, Neymar, who had struggled with cramp during the second half of a tight game that ended 1-1 after extra time, was left with the chance to win it for Brazil.

The 24-year-old kissed the ball, put it on the spot and composed himself. A short pause in his run-up failed to tempt German goalkeeper Timo Horn into an early dive but Neymar held his nerve to slam the ball high into the net.

He turned to run in delight but did not get far, instead sinking to his knees in tears as the stadium, and the nation outside, erupted in a frenzy of celebration at Brazil’s first Olympic men’s soccer gold medal.

Neymar had an outstanding game, scoring a superb free-kick midway through the first half to give Brazil the lead.

The victory also brought some redemption for the forward, who had been pilloried by the Brazilian public in the early stages of the tournament. Now he is back in their hearts.

“This is one of the best things that has happened in my life,” Neymar said of scoring the decisive penalty in the shootout to win the gold medal.

“That’s it. Now they’ll (the critics) will have to eat their words.”

In a televised interview after the game, Neymar also said he had told national coach Tite that he did not want to continue as captain.

“It was an honour, something that I received with all my heart,” he added.

It was evident from the start that Neymar knew the nation’s hopes of winning a first men’s Olympic soccer gold rested largely on his shoulders. He sang the national anthem with gusto, hand on heart and eyes raised to the heavens.

The Germans knew it too.

In the 25th minute he was upended by Sven Bender, then fouled again a minute later.

From the free kick just outside the penalty area, however, Neymar fired the ball on target with deadly precision and it went in off the underside of the crossbar.

In celebration, Neymar struck sprinter Usain Bolt’s trademark pose as delirious fans sang: “Ole, ole, ole – Neymar, Neymar”.

It looked as if the perfect script was being written for the host nation but the second half was a tougher affair as Germany asserted themselves and equalized.

With Brazil’s dreams of gold in danger of being shattered, Neymar came close in the 77th minute with a little jink and a shot from the outside the area.

Suffering from an apparent injury, desperation showed on his face when he lofted a shot over in the second half of extra time.

Before taking corners, he would face the crowd and whip them up with his arms.

It was all in contrast to the start of the tournament when his fitness, leadership abilities and lifestyle had all been questioned.

After lacklustre scoreless draws against South Africa and Iraq, he was mocked by fans, some of who contrasted him unfavourably with Marta, who wears the number 10 for the Brazil women’s team.

Neymar performed well against Colombia in the quarters, then confirmed he was back in business in the semi-final against Honduras, scoring the fastest goal in Olympic history just 15 seconds after the start. He added another in a 6-0 rout.

His performance in Saturday’s final was on another level.

The victory also gave Brazil a measure of revenge for their humiliating 7-1 defeat by Germany in the semi-finals on the 2014 World Cup on home soil — a game Neymar had to watch from the sidelines due to injury.

Brazil coach Rogerio Micale paid tribute to Neymar after the game.

“He is a player of 24 years of age and already has and Olympic gold and silver medal. I think the natural step for him now is to win a World Cup and he is going to fight for it, he has the attributes,” he said.

As for comparisons to other Brazilian greats such as Pele and Zico? “Everything is pointing in that direction.”