Miles Scott participated in events across the city including fighting mock crimes and receiving an honor from the mayor.
Make-A-Wish Foundation, which organized the event, received pledges from more than 10,000 people to lend a hand.
Miles Scott, in treatment for several years, is now said to be in remission.
According to local television, Miles Scott thought he was just on his way to get a Batman costume so he could dress like his favorite superhero.
But then he heard a broadcast from San Francisco Police Chief Greg Suhr appealing for help from “Batkid”.
Next, Batkid saved a “damsel in distress”, tied to cable car tracks along a major urban street.
A San Francisco Chronicle live blog of the day’s events showed hundreds of people cheering Miles Scott on during the “rescue”.
Miles Scott was ferried from events in one of two “Batmobiles”, or black Lamborghinis with Batman removable stickers, which were escorted by police.
Later, the little boy foiled a faux robbery in the city’s financial district with the help of an adult Batman impersonator.
Authorities who participated in the day’s events pretended to apprehend the villain, the Riddler.
Miles Scott also travelled to AT&T Park to rescue the San Francisco Giants baseball team mascot by disarming a fake bomb planted by another classic Batman baddie, the Penguin.
The US justice department even prepared an indictment for the Riddler and the Penguin.
Towards the end of the day San Francisco Mayor Ed Lee gave Miles a key to the city.
President Barack Obama praised the mini-caped crusader in a video from the White House, saying: “Way to go, Miles! Way to save Gotham.”
An estimated 7,000 people turned up to help make Miles Scott’s wish come true.
The Make-A-Wish Foundation said the event was “on the scale of a military operation”.
In real life, Miles Scott has defeated an enemy even more ruthless than Batman’s nemeses – he is presently recovering from leukaemia, with which he was diagnosed at 18 months old.
Miles Scott’s mother, Natalie, said Friday was a “celebration” of her son’s completion of treatment in June.
“This wish has meant closure for our family and an end to over three years of putting toxic drugs in our son’s body,” Natalie Scott wrote in a statement on the foundation’s website.
Miles’ father, Nick Scott, thanked the charity and everyone else who took part.
“All the doctors, nurses and all the other parents that have to deal with the same thing we’re going through, I hope they get a conclusion to their illnesses like we’re getting,” Nick Scott told KGO-TV.
UoWzs2vdipAImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…