San Francisco was beset by a wave of crime on Friday, as a woman was taken hostage and tied to cable car tracks, a criminal calling himself the Riddler attempted to rob a bank vault, and a miscreant known as Penguin generally made a nuisance of himself in the downtown area.

Happily, each incident was staged: an attempt on the part the charity Make-a-Wish to give five-year-old Miles Scott, who is recovering from leukaemia, a memorable day assisting his favourite superhero.

San Francisco’s mayor and police were among thousands involved in an extraordnary day that gripped the city and caught the attention of the White House. Miles’s day began with a fraught message from police chief Greg Suhr, alerting “Batkid” to the various criminal activities and pleading with him to assist. Miles acquiesced, and was collected by a man dressed as Batman who was driving a vehicle which bore a passing resemblance to the Batmobile.

With little time to waste, the pair hastened to the Grand Hyatt in San Francisco’s Union Square, where an unnamed woman had been tied up on cable car tracks with what appeared to be an improvised explosive device strapped to her back.

#SFBatkid Damsel played the role quite well….she waited a long time pic.twitter.com/KIKFWrWid4 — Wayne Freedman (@WayneFreedman) November 15, 2013

A large crowd had gathered at the scene as Batkid arrived and sprinted over to the woman. After a tense few moments a cheer went up as Batkid managed to free the woman from her bonds. The device did not detonate.

BAT KID SAVES THE CITY: Photographer @Jamesco captured this magic moment "You did it #SFBatKid!" pic.twitter.com/q0nGSNBR6s — NewsBreaker (@NewsBreaker) November 15, 2013

Less than an hour later, Batkid was summoned back to Union Square, where a criminal mastermind known as The Riddler was attempting to rob a bank vault.

Batkid successfully downed the villain, despite significant disadvantages in height and strength, and The Riddler was taken away in a San Francisco police department truck. SFPD did not immediately respond to questions regarding charges against The Riddler.

Later, Batkid apprehended a known felon called Penguin before being handed the key to the city by an understandably grateful mayor. The stunt gripped the city: "This has turned into a full blown phenomenon," sair Suhr, the police chief .

The White House sent out a tweet encouraging Batkid to "Go get 'em!" In a video recording, President Barack Obama said, "Way to go, Miles! Way to save Gotham!"

Make-a-Wish grants the wishes of children with life-threatening illnesses. Miles, a Batman fan, had one wish: “To be Batkid.” Make-a-Wish reached out through email and social networks, asking for help making Miles’s wish come true. The charity was inundated with offers to help. Volunteers formed the crowd or pretended to be villains.

The San Francisco Chronicle is among the many organisations involved, and its Friday front page was dedicated to the superhero. The headline? “Batkid Saves City”.

Hot off the presses! #sfbatkid catches riddler robbing Gotham bank pic.twitter.com/6rMJqN2ZXu — Bob Redell (@BobNBC) November 15, 2013