By Stephen M. Silverman
Updated May 13, 2003 01:15 PM

Although the original “Spider-Man” grossed more than $820 million around the world — due in no small part to Tobey Maguire — the 27-year-old actor found himself fired from the sequel, he tells the Los Angeles Times.

Of course, this story has a happy ending: “The Amazing Spider-Man” is currently shooting in New York, with Maguire returning as the arachnid superhero.

But it almost didn’t happen, and Jake Gyllenhaal nearly took his place. In a lengthy analysis of Maguire’s rise and fall — and rise again — the Times reports that Maguire was dismissed from the “Spider-Man” sequel earlier this year.

He was reinstated, the Times says, only thanks to some behind-the-scenes maneuvering by his girlfriend’s father, Ron Meyer — the head of Universal Pictures, which produced Maguire’s upcoming movie “Seabiscuit,” about the champion racehorse of the 1930s. (Maguire is dating Jennifer Meyer.)

Maguire reportedly was fired after trying to dictate how and when “The Amazing Spider-Man” would be shot, because of a bad back. In one incident, Maguire — who experienced pain while riding a horse in “Seabiscuit” — sent his neurosurgeon to tell the head of the studio and director Sam Raimi what stunts he could and could not do, the Times reports.

Maguire also failed to show up for a computer scan of his body, part of the groundwork for the film’s digital effects. “I could have come in a little earlier (to be scanned), but I was exhausted and didn’t understand the importance of it,” Maguire tells the Times. “If I had understood the great importance of it for Sam, then I probably would have kicked myself … and done it anyway.”

Still, as a result of his attitude and behavior, Columbia Pictures apparently was ready to replace Maguire with Gyllenhaal — secure in the belief that, like James Bond, the role was bigger than the actor.

Maguire eventually buckled and made nice with Raimi, and the only loser in the deal appears to be poor Jake Gyllenhaal.

“I feel I learned a lesson,” a now-contrite Maguire tells the paper. “The movie is the most important thing.”