In a space comparable to the famous Cavern Club in Liverpool where the Beatles began their career, McCartney, 81, performed a 22-song set on Tuesday night that included hits from the group and his solo career.
"It was like winning the lottery without having bought a ticket," said 33-year-old civil servant Amanda Cardoso of getting into the concert that was announced at the last minute.
"I'd already experienced moments I thought could never be beaten, but yesterday I was able to see my greatest musical icon just a metre away from me, interacting with me at various times in a place that was transformed into the Cavern Club for an hour and forty minutes," she said.
McCartney announced on social media on Tuesday morning that he would be playing later that same day at the Clube do Choro to celebrate the arrival of his Got Back tour in Brazil, stressing that tickets would be "extremely limited".
The option to buy tickets was only released to those who had already purchased seats for his performance scheduled for Thursday at the Mané Garrincha stadium. Tickets sold out in just a few minutes.
Fans who managed to buy tickets received wristbands for the concert. Upon arrival, event organisers sealed up fans' mobile phones and cameras to prevent images being recorded. Anyone who did not comply would be removed from the venue by security.
McCartney's Got Back tour will pass through the cities of Brasilia, Belo Horizonte, Sao Paulo, Curitiba and Rio de Janeiro over the next two weeks.