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.
UoWzs2vdipAThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…