The 76-year-old Argentine, an aficionado of Buenos Aires club San Lorenzo, shook hands with football icon Zico as well as Olympic athletes before receiving the keys to the metropolis.
The pope made the sign of the cross and sprinkled holy water on the Olympic flag as he stood on the balcony of the Rio City Hall -- the same spot where the symbol of Carnival, King Momo, accepts the city's keys every year to kick off the wild annual party.
Rio will host World Cup games next year before organizing the 2016 Olympic Games.
The pope arrived in Brazil on Monday for a weeklong visit coinciding with World Youth Day, an event drawing some 1.5 million young Catholics from 170 nations.