HBO will buy “Bad Education,” a dark look at corruption in a Long Island public school district that earned strong reviews after it premiered at this year’s Toronto International Film Festival.

The pact is for just under $20 million, making it the largest deal of an otherwise lackluster movie market at the festival. With a cast that includes Hugh Jackman, Ray Romano and Allison Janney, “Bad Education” was seen as the most commercially viable of the projects on the prowl for distribution deals in Toronto.

Its purchase by a premium cable channel is a sign of the fierce headwinds that indie productions face at the box office. Those involved will justify the lack of a more traditional release by emphasizing the eye-popping offer the filmmakers received from HBO. The fact is, however, that the producers and creative team behind “Bad Education” were looking to push the movie into Oscar contention by finding a distributor who would release it this year. That didn’t happen. Instead, “Bad Education” will be jockeying for Emmy attention in 2020.

Forgoing a theatrical release might not be a bad thing. It means that “Bad Education’s” success or failure won’t be defined by ticket sales. That prevents it from becoming another cautionary tale along the lines of “Blinded by the Light” or “Patti Cake$,” festival favorites that scored big sales at festivals only to fail to attract mainstream crowds.

The dramedy is a fact-based story that follows a group of school employees in Roslyn, Long Island who bilk the district for millions of dollars by sticking it with the bill for everything from home improvements to Concorde flights to Europe. Jackman plays superintendent Dr. Frank Tassone and Janney portrays his tough-talking accomplice, the assistant superintendent Pam Gluckin. The film was directed by Cory Finley (“Thoroughbreds”) and written by Mike Makowsky (“I Think We’re Alone Now”).

Critics praised the performances and Finley’s deft balance of satire and social commentary. Variety‘s Peter Debruge called the film one of the festival’s best, reserving particular praise for Jackman, who he wrote, “delivers an acting master class, trading on his charismatic star persona to reveal the rotten core of bad-apple superintendent Frank Tassone.”

HBO will air the feature globally where it has networks and streaming services. CAA Media Finance and Endeavor Content brokered the “Bad Education” deal. Deadline first reported the sale.