Brazilian football legend Mario Zagallo, the first person to win the World Cup as both player and coach, was discharged from hospital Friday after a more than two-week stay for a urinary infection.

"Thank you all for your affection. I'm back," Zagallo, 92, said in a video posted on Instagram that showed him returning to his house in Rio de Janeiro in a wheelchair.

"You're going to have to keep putting up with me!" he added in a message -- a quip referencing his famous catchphrase to critics of his management of the Brazilian national team.

Zagallo was admitted on August 15 to the Barra D'Or hospital in Rio, a week after his 92nd birthday.

He spent nearly two weeks in semi-intensive care in the same hospital last year for a respiratory infection.

Zagallo played alongside Pele in Brazil's 1958 and 1962 World Cup-winning teams, standing out for his unique mix of attacking flair and defensive solidity.

He then coached the Brazil side that won the 1970 World Cup, considered by many the greatest team in history.

The only other men to win the World Cup as both player and coach are Franz Beckenbauer of Germany (1974 and 1990) and Didier Deschamps of France (1998 and 2018).