Miranda headed an injury-time winner as Brazil beat South American rivals Argentina to win a four-team friendly tournament in Saudi Arabia.
The defender was left unmarked at the near post to head home from a corner.
The Inter Milan player thumped in the 93rd-minute header from Neymar's corner when the match between the fierce South American rivals seemed destined for a stalemate.
It was a dramatic finale to what had been a drab contest of few chances at King Abdullah Sports City stadium on Tuesday.
Neymar, Philippe Coutinho and Roberto Firmino all disappointed against an inexperienced Argentina side lacking star names, including Lionel Messi.
The lapse spoiled an otherwise strong defensive performance from Argentina, who contained Brazil for long periods.
With Sergio Aguero, Gonzalo Higuain and Angel di Maria also absent, the game will be heartening for temporary boss Lionel Scaloni, despite defeat, after a defensive but disciplined and committed display from his young side.
His Brazilian counterpart Tite will have more concerns following a largely uninspiring and flat performance from a team with too much attacking talent to offer any convincing excuses.
With Neymar to the fore, Brazil exerted late pressure and could have scored in the few minutes before Miranda struck.
Casemiro came close with a 25-meter free kick manufactured by Neymar that flew past Romero's left post. Then Nicolas Otamendi stuck out a boot to deflect a diverted shot from Richarlison in the last minute.
Argentina's best chance came during a period of pressure around the hour mark, when Paredes hit a swerving, dipping drive that had Brazil keeper Alisson beaten.
Messi sat out Argentina's last three matches, all friendlies, since the country's disappointing last 16 elimination from the World Cup in Russia.
He is believed to have asked for some time off from international duty ahead of next year's Copa America in Brazil.
It was the 104th time the South American arch-rivals have faced each other in an official match, with Brazil marginally ahead on 41 wins to 38, with 26 draws.
The two sides last met in June 2017 in a friendly in Australia, won 1-0 by Argentina, but Brazil romped to a 3-0 success in their last competitive fixture, a World Cup qualifier in November 2016.
Argentina XI: Romero; Saravia, Otamendi, Pezzella, Tagliafico; Paredes, Correa, Battaglia, Lo Celso, Dybala; Icardi
Brazil XI: Alisson, Danilo, Marquinhos, Miranda, Filipe Luis; Casemiro, Arthur, Coutinho; Neymar, Firmino, Jesus