Pelé has been buried in his final resting place with fans lining the streets as his casket was driven through his hometown of Santos on a fire truck.
He was laid to rest in the city where he grew up, became famous, and helped make into a global capital of his sport.
Newly inaugurated President Luiz Inácio Lula da Silva paid his respects at Vila Belmiro, the stadium where Pelé played for most of his career.
Mass was held at the Vila Belmiro stadium before the black casket was driven through the streets.
It was taken into the Memorial Necrópole Ecumênicaa cemetery as bands played the Santos team's official song, and a Catholic hymn.
It is a vertical cemetery with 14 levels.
Before the golden-wrapped casket arrived, attendees sang samba songs that Pelé had liked.
One fan questioned why the likes of Ronaldo Nazario, Kaká and Neymar were not in attendance.
"Do they think they will be remembered like Pelé will?" Claudionor Alves said.
"These guys didn't want to stop their vacations, that's the problem."
Another notable absentee was Jair Bolsonaro, whose term as president ended December 31.
Geovana Sarmento, 17, waited in the three-hour line to view Pelé's body as it lay in repose.
She came with her father, who was wearing a Brazil shirt with Pelé's name.
"I am not a Santos fan, neither is my father. But this guy invented Brazil's national team," she said.
"He made Santos stronger, he made it big, how could you not respect him?
"He is one of the greatest people ever, we needed to honour him."
Caio Zalke, 35, wore a Brazil shirt as he waited in line.
"Pelé is the most important Brazilian of all time. He made the sport important for Brazil and he made Brazil important for the world," he said.
Rows of shirts with Pelé's number 10 were placed behind one of the goals, waving in the wind in the stadium.
A section of the stands was filling up with bouquets of flowers placed by mourners and sent by clubs and star players, including Neymar and Ronaldo.
Loudspeakers played the song Eu sou Pelé (I am Pelé) which was recorded by the Brazilian himself.
The crowd was mostly local, although some came from far away.
Many mourners were too young ever to have seen Pelé play.
"I never saw him play, but loving Pelé is a tradition that goes from father to son in Santos," fan Claudio Carrança said.
"I learned his history, saw his goals, and I see how Santos FC is important because he is important.
"I know some Santos fans have children supporting other teams. But that's just because they never saw Pelé in action. If they had, they would feel this gratitude I feel now."
Among those at the stadium was Pelé's best friend Manoel Maria, also a former Santos player.
"If I had all the wealth in the world I would never be able to repay what this man did for me and my family," Maria said.
"He was as great a man as he was as a player; the best of all time. His legacy will outlive us all. And that can be seen in this long line with people of all ages here."
Another fan and friend in line was Brazilian Supreme Court Justice Gilmar Mendes.
"It is a very sad moment, but we are now seeing the real meaning of this legendary player to our country," Mr Mendes said.
"My office has shirts signed by Pelé, a picture of him as a goalkeeper, also signed by him. DVDs, photos, a big collection of him."
Pelé led Brazil to World Cup titles in 1958, 1962 and 1970 and remains one of the team's all-time leading scorers with 77 goals.
AP