Make-A-Wish has fulfilled similar wishes across the country. In Anaheim, a child became Batman's sidekick, Robin; and in Seattle a child was a secret agent, said Jen Wilson, a spokeswoman for the local organization.
The San Francisco Chronicle, KGO-TV and thousands of volunteers participated in the event.
The Chronicle distributed hundreds of copies of special-edition newspapers with the headline, "Batkid Saves City," in Union Square.
Associated Press writers Channing Joseph and Terry Collins contributed to this report.