Brazil clinched their first ever Olympic football title by beating Germany 5-4 on penalties at the Maracana on Saturday, Xinhua news agency reported.
"I waited my entire life to see Brazil win a gold medal in football and now my dream has come true," Pele said on Twitter.
The Brazilian legend, who declined a request to participate in the Rio 2016 opening ceremony due to ill health, also praised organisers for a successful Games.
"Brazil welcomed the world with open arms and showed everyone our special way of life - in both work and play," the 75-year-old said in a separate tweet.
"Our role as proud hosts of the World Cup and Olympics has come to a close. I wish you all a safe journey home. Please visit us again soon."
Pele's comments came as the closing ceremony was being held at the Maracana, drawing the curtain on the first Olympics in South America.