“The Girl on the Train” pulled into the station with a $24.7 million opening, a solid result despite the fact that the mystery debuted as much of the U.S. Southeast was being pummeled by Hurricane Matthew.

Its success is a shot in the arm to DreamWorks, which optioned the Paula Hawkins best-seller about an alcoholic woman (Emily Blunt) who must piece together a mysterious disappearance. The company has suffered a string of flops in recent years, most recently shouldering the twin duds of “The BFG” and “The Light Between Oceans.” However, “The Girl on the Train” kicks off a new five-year distribution deal with Universal Pictures, one that will see the company rebranded as Amblin Partners, complete with backing from Reliance, Entertainment One, and Participant. Over the weekend, Amblin announced that Alibaba Pictures will take an equity stake in the production company. “The Girl on the Train” cost $45 million to make.

“We are thrilled with the results of the first film in our new partnership with Amblin,” said Nick Carpou, Universal’s domestic distribution chief. “Their passion and commitment to bringing high quality stories to theaters, coupled with our expertise in marketing and distribution, makes for a bright future.”

Nate Parker’s “The Birth of a Nation” was not as fortunate, premiering to a disappointing $7.1 million across 2,105 theaters. The biopic about slave rebellion leader Nat Turner was a sensation at the Sundance Film Festival, where it premiered to a rapturous standing ovation and sold to Fox Searchlight for a record-shattering $17.5 million. But the release was derailed after rape allegations against Parker and his “The Birth of a Nation” co-writer Jean Celestin resurfaced. Both men were accused of sexually assaulting a college classmate over a decade ago. Though they were ultimately acquitted of those charges, news broke this summer that their accuser had committed suicide in 2012. The ensuing controversy overshadowed the strong reviews and may have hurt the film’s Oscar chances.

“This is a pretty pedestrian result,” said Jeff Bock, a box office analyst with Exhibitor Relations. “Clearly, not all press is good press.”

Searchlight, however, believes that the film’s A CinemaScore could lead to robust word-of-mouth, which might help “The Birth of a Nation” draw an audience in the coming weeks. Distribution chief Frank Rodriguez said he was pleased by how diverse the audience for the film was — 54% of ticket buyers were African-American and 42% were Caucasian. He stressed that it was difficult to know how many people had opted not to see the picture because of coverage of the rape accusation.

“The film stands on its own,” said Rodriguez. “What it was before at Sundance, the actual celluloid, the image, is still the same, but the perception may have changed and there’s not too much anyone can do about it.”

Hurricane Matthew led to theater closures in Florida, South Carolina, and other Southern states. Studio executives believe that it could have depressed ticket sales by between 2% and 4%.

The weekend’s other wide release, “Middle School: The Worst Years of My Life,” attempted to court younger crowds, opening to $6.9 million from 2,822 theaters. The film follows a teenager who cooks up a series of pranks to embarrass his autocratic principal. It is based on a popular series of books by James Patterson. CBS Films produced the movie for $11 million, with Lionsgate distributing the picture.

Last weekend’s champ, “Miss Peregrine’s School for Peculiar Children,” fell roughly 50% to $15 million for a second place finish. That puts the Tim Burton fantasy’s total at $51.1 million. Fox backed the film, which carries a sizable $110 million price tag, and will need foreign audiences to come out in force if it wants to make a profit.

Lionsgate’s “Deepwater Horizon” continued to struggle, taking in $11.7 million, and bringing its domestic total to $38.5 million. The action-drama about the men and women caught up in one of the worst oil spills in history earned solid reviews, but cost a massive $120 million after tax credits were taken into account. It’s shaping up to be a money loser.

Sony’s “The Magnificent Seven” took fourth place with $9.1 million, pushing the Western remake’s haul to $75.9 million. “Storks,” the Warner Bros. animated comedy, rounded out the top five with $8.4 million, bringing its stateside receipts to $50.1 million.

It’s been a rough fall for the movie business. Ticket sales for the season are down 5.7% year-over-year, as hits like “Sully” have failed to eclipse 2015 blockbusters such as “The Martian” and “Hotel Transylvania 2.” Year-to-date, however, the box office remains up 3.9%, and analysts are hopeful that upcoming releases such as “Doctor Strange” and “Fantastic Beasts and Where to Find Them” will get consumers back in the habit of going to the multiplex.

“We’re just waiting for a breakout hit,” said Paul Dergarabedian, senior media analyst at comScore. “We need something to get us out of this box office funk.”