SAN FRANCISCO: Dressed in a black Batman costume, his fists clenched as he took on foe after foe around San Francisco, a 5-year-old boy who has battled leukemia for years fulfilled his wish to be his favorite superhero.

In the process, Miles Scott became a darling of social media and attracted thousands of fans around the country, including the White House.

Even President Barack Obama got in on the act after the story went viral, sending Scott a video message telling him “Way to go!”

“When you have an illness, it’s very important to know you have a support system,” said Gina Futrell, a 51-year-old with multiple sclerosis, who was among a large crowd gathered at Union Square for a chance to so see the “Batkid” in action. “I have an extremely strong support system, and I hope he does too. He’s such a little hero.”

Batkid was called into service by Police Chief Greg Suhr and spent the day zooming from one “crime scene” to the next. Accompanied by an adult Batman impersonator, Batkid rescued a damsel in distress from cable car tracks, captured the Riddler as he robbed a bank, and saved the San Francisco Giants mascot — Lou Seal — from the Penguin’s clutches.

Miles was able to fulfill his wish through the Make-A-Wish Foundation, the city and volunteers who stepped forward to help. He was diagnosed three years ago, underwent chemotherapy treatment and is now in remission.

Batkid had a police escort worthy of a dignitary as he sped around the city in a black Lamborghini with a Batman decal, with officers blocking traffic and riding alongside him on motorcycles.