The three-time World Cup winner was discharged late Monday from a Paris hospital where he had
been taken after falling ill following an appearance at a promotional event in the French capital with France striker Kylian Mbappe.
After arriving at the Sao Paulo-Guarulhos airport in Brazil, the 78-year-old was seen in a wheelchair and was driven away in a van, an AFP reporter said.
"Once again, thank God, everything went well. I'm alive. Long live Brazil," Pele said on arrival.
Before he was discharged, current Brazil star Neymar, who plays alongside Mbappe for Paris Saint-Germain, paid him a visit in hospital in the Parisian suburbs.
Neymar posted a photo on his Instagram account Monday of himself alongside a smiling Pele in his hospital bed with the two holding hands.
Brazil's G1 reported that Pele had intended to come out of hospital on Saturday to return to Brazil, but had been delayed by further tests.
The infection was not serious and was under control, members of Pele's entourage had said.
Pele has had several health scares in recent years.
A similar infection put him in intensive care in November 2014.
In 2016, Pele, who played 1,363 professional matches, scoring 1,281 goals, was unable to light the flame at the Rio Olympics because of severe pain in the hip.
In January 2018, he cancelled a trip to London fearing a "stressful" and "tiring" journey.