TORONTO (AP) — Brad Pitt’s about as free a free agent as they come in Hollywood, a superstar so big he could play ball with just about any team, on any film project he likes.

Yet he wanted to make “Moneyball” so much that he stuck with it for years, even after pal Steven Soderbergh, his director on the “Ocean’s Eleven” flicks, departed the film in a script squabble with Sony Pictures.

Pitt was obsessed with making a movie out of Michael Lewis’ best-seller “Moneyball: The Art of Winning an Unfair Game,” which chronicles Oakland A’s general manager Billy Beane’s revolutionary experiment to build a winning team out of unlikely prospects and castoff players chosen because they could be had cheaply and fit new mathematical models that ran counter to traditional baseball scouting stats.

“I couldn’t let go of the book,” Pitt said in an interview at the Toronto International Film Festival, where “Moneyball” premiered ahead of its theatrical release Friday. “It was just something I wanted to put out there.”

The Soderbergh-directed version of “Moneyball” fell apart two years ago after Sony pulled the plug on it a few days before filming was to start. Soderbergh had submitted dramatic revisions to the script from Academy Award-winning screenwriter Steven Zaillian (“Schindler’s List”), and Sony was unwilling to go along with the changes, which reportedly included interview segments with real players and team officials and re-enactments to tell the story as realistically as possible.

Just as Beane had to rebuild his team in 2002 after losing key players to free agency, Sony brought in fresh talent to revive “Moneyball.” Hollywood heavyweight Scott Rudin joined producers Pitt, Michael De Luca and Rachael Horovitz to help jump-start the film. Aaron Sorkin, who collaborated with Rudin on last year’s “The Social Network” and won an Oscar for the screenplay, did a new draft of the “Moneyball” script, sharing the writing credit with Zaillian.

The studio took a risk on a director to replace Soderbergh, choosing Bennett Miller, a 2005 Oscar nominee for his fiction feature debut “Capote.” Miller came from the artsier, lower-budgeted independent world and had made only one film, a documentary, before “Capote.”

The timing was right for Miller, who had spent a few years trying to get a film of his own off the ground and “had just conceded it wasn’t going to happen,” he said.

“Moneyball” probably wouldn’t have happened either without Pitt going to bat for it, Miller said.

“It needed a champion for it to happen, because there’s not a ton in the book that screams box office. It’s not an obvious translation to film. Baseball movies are not really attractive to investors because the markets are limited once you get out of the United States,” Miller said. “Unless you have Brad Pitt saying, ‘I want this to happen, and I’m going to see this thing through,’ I’m sure it goes away.”

So Miller and Pitt met, they connected, and “Moneyball” was back on the base paths.

The result is impressive. Like “The Social Network,” “Moneyball” crackles with sharp, insightful dialogue. Like “Capote,” it’s a rich character portrait of a driven figure (and it doesn’t hurt to have Philip Seymour Hoffman, who won the best-actor Oscar in the title role of Miller’s Truman Capote drama, on board as the A’s skeptical field manager).

And Beane is a character Pitt wears like a second skin, the actor applying all his charm and charisma as he cuts deals, butts heads with the team’s scouting staff, absorbs the reproaches of scornful fans and sports commentators and champions the unorthodox numbers crunching of his new aide (Jonah Hill).

“It speaks to the power of a role fitting someone so powerfully,” said co-star Chris Pratt, who plays one of Beane’s new acquisitions, player Scott Hatteberg. “Put them in a room together, you’re like, wow. If you’re looking at Billy Beane, the first person you’re going to think to play him is Brad Pitt.”

Hill plays Peter Brand, a composite of a number of economic analysts Beane enlisted as the A’s adopted sabermetrics, a system that places more value on a player’s ability to get on base and produce runs than on such traditional stats as batting averages.

A small-market team, the A’s had to find a way to compete with deep-pocketed franchises such as the New York Yankees, who had the money to go out and buy the talent they wanted.

“I’m very interested in equality, and here you had a team with $38 million, and how are they going to compete with a team that has $140 million?” Pitt said. “How do you level that playing field? So by necessity, they had to tear it all down and question everything, and then the (crap) they took for doing it. They were called heretics and fools and boobs. And yet they punched through and did something that just altered the game a couple degrees.”

Among Beane’s unconventional moves recounted in the film: trading for former Atlanta Braves star David Justice, who was injury-prone and aging; signing catcher Hatteberg and retraining him as a first baseman, a position he had never played; and bringing in relief pitcher Chad Bradford, who had an unusual side-armed delivery and not much speed to his fastballs.

The moves pay off as the A’s earn the American League West title, with Hatteberg the surprise hero as the team wins an AL record 20-straight games along the way.

The story of that pioneering season, finding a way to win against the odds, parallels the story of how “Moneyball” made it to the screen after most in Hollywood had written it off.

“This whole idea of failure, and how failure can be a tombstone written as the end,” Pitt said. “To me, there’s no win without failure. Failure becomes impetus for the next win. It’s this ongoing part of your trip.”