Paula Wagner’s five-year quest to get the story of Supreme Court justice Thurgood Marshall onto screen was “absolutely worth it,” the Hollywood producer told filmmakers at Poland’s Camerimage fest on Friday.

The inspiring biopic, “Marshall,” which opened in October, focuses on an early case the young Marshall takes on in Connecticut, defending a black chauffeur accused of rape and attempted murder against his rich, white employer. As the future jurist on the highest court in the land develops his strategy, viewers come to grips with the extent of racism and bias in the justice system that’s hardly limited to the South.

Set in 1940 and featuring “Black Panther” star Chadwick Boseman as Marshall, the courtroom drama avoids simple hero myths and portrays the defense attorney’s substantial (and deserving) ego as a factor that may endanger his success, as Variety reviewer Peter Debruge points out.

The true story, in which Marshall’s employer, the NAACP, hired an inexperienced white co-counsel, Sam Friedman (Josh Gad), to team with him, builds tension around Marshall’s compromised position. The judge in the case (James Cromwell) forbids the black attorney from speaking in court, among other challenges.

Meanwhile, the alleged victim (Kate Hudson), although clearly willing to sacrifice a man’s life to save her reputation, is also played with nuance in the story, directed by Reginald Hudlin, a filmmaker mainly known until now for comedies such as “House Party” and “The Ladies Man.”

But Wagner, who produced the film under her shingle Chestnut Ridge Productions, said she likes to cast against type, something she learned is a powerful tool early in her career as a Hollywood agent for Creative Artists Agency, where she repped top talents including Sean Penn, Val Kilmer, Demi Moore, Liam Neeson, Oliver Stone and Robert Towne.

Her work back then with Tom Cruise – Wagner co-produced the first “Mission: Impossible” film with him after founding Cruise/Wagner Productions in 1993 – led to a partnership between the two in running United Artists from 2006 to 2008. Wagner then left to found her company, named for a street in her home town in Youngstown, Ohio.

“I wanted to be part of the process,” she said of moving into the producer role in her career, which began as a 13-year-old stage actress. Wagner had an unlikely success story in her move to Hollywood and advancement through the ranks, she confessed.

Throughout her changing career roles, said Wagner, she has sought out stories that stand out for exceptional actors. In this case, the “Marshall” script, although rewritten several times and penned by an attorney, not a screenwriter, Michael Koskoff, and later his son Jacob Koskoff, met her test.

“It had something you could take away that is an inspiration,” she said.

After 25 or 30 drafts – a level of development not unusual for a Wagner project – she found that the story was indeed of interest to major Hollywood studios, she said.

But with most now owned by massive media companies, finding the money for small, meaningful stories like the rise of America’s first black Supreme Court justice, is harder than ever, according to Wagner. It’s a climate in which a thoughtful $15 million story is harder to finance than a $115 superhero movie, she says: “We’re in an era of branded entertainment.”

Persisting with the development was the only way forward – something Wagner said she learned long ago for worthwhile films. The limited budget, along with a nose for excellent incentive packages, led the project to Buffalo, New York, where they found courthouse architecture that worked perfectly for the era.

Meanwhile, said Wagner, the theme of America’s long struggle for racial justice proved as relevant as ever as the project moved along.

“I’m really proud of this movie,” she said.