Despite the TMZ videos and boycott threats, “A Dog’s Purpose” still managed to pull in family audiences, who apparently were not convinced of the significance of footage of a cowering German Shepherd being forced into rushing water.

The story of a dog who gets reincarnated, living through and playing “man’s best friend” to multiple masters, brought in $18.4 million in its opening weekend. That’s in line with the openings of other films for animal-lovers, such as “Eight Below” ($20.1 million) and “Dolphin Tale” ($19.1 million), neither one of which raised the ire of PETA. Universal and Amblin partnered on “A Dog’s Purpose.” It has a $22 million production budget.

“It opened right in the sweet spot, if not on the higher end of expectations,” said Nick Carpou, Universal’s domestic distribution chief. “The fact that the film has worked so well speaks directly to its resonating message. The controversy surrounding the protests generated by a highly edited video is hard to ignore. However, the box office shows that this film rises above that.”

He noted that even at multiplexes where there were protests, such as the Arclight in Los Angeles, the film did strong business. It’s a solid opening, one that suggests that the companies were successful in containing the wave of bad publicity that threatened “A Dog’s Purpose’s” release. After TMZ released the video, director Lasse Hallstrom, producer Gavin Polone, and various cast members expressed their outrage. They placed most of the blame on the film’s second-unit production team or argued that the video was manipulated, while Universal, looking to contain the blowback, cancelled the film’s premiere. The protest threats and viral video did take a bite out of the grosses — tracking two weeks ago suggested the film would open to as much as $24 million — but the public relations headaches weren’t fatal.

“What happened did hurt the box office,” said Jeff Bock, an analyst with Exhibitor Relations. “I think $25 million was easily in reach before the controversy. It could hurt it in the long run. I don’t think it will sustain itself like a family film usually does.”

One film is showing some impressive endurance. Blumhouse and Univeral’s “Split” managed to hold on to the top spot for the second straight weekend, earning $26.3 million. The low-budget thriller film has made $78 million domestically, and marks a return to form for M. Night Shyamalan. The director of “The Sixth Sense” has reinvented himself in recent years by working with producer Jason Blum. Once white-hot, his star dimmed with bombs such as “The Lady in the Water” and “After Earth.” However, “The Visit,” another Blumhouse hit he directed, and now “Split,” have restored some of Shyamalan’s luster.

“Typically movies like this open big and then have a huge drop,” said Paul Dergarabedian, senior media analyst at ComScore. “This was such a smart movie. It’s well acted and it’s just a cut above a typical movie in this genre that you’re seeing that in its hold. It’s a pure reflection of the positive sentiment on social media.”

Sony’s “Resident Evil: The Final Chapter” debuted to $13.8 million for a fourth place finish. The latest installment in the video game franchise has earned nearly $80 million worldwide. Sony worldwide marketing and distribution chief Josh Greenstein said the stateside opening was in line with the studio’s expectations and noted that the “Resident Evil” series tends to play better abroad. The previous two films made roughly 80% of their grosses from foreign territories.

“‘Resident Evil’ is built for an international audience,” he said, adding, “This is a perfect example of looking at a film as a global film and not as a U.S.-centric one.”

It’s also in keeping with what Sony chief Tom Rothman has tried to emphasize since taking over at the studio in 2015. Under Rothman, Sony has built up its local language division, creating more films targeted at foreign audiences, while emphasizing pictures like “Blade Runner 2” and “Spider-Man: Homecoming” that are geared at the global marketplace. With the weekend’s grosses, the “Resident Evil” series has now cruised past the $1 billion mark to become the biggest video game-based franchise in history.

Fox’s “Hidden Figures” continued to pull in crowds, adding $14 million to its gross to push its domestic total to $104 million. The drama about African-American scientists in the early days of the space program was nominated for a Best Picture Academy Award this week.

“La La Land” capitalized on its 14 Oscar nominations to the tune of $12 million. That pushes the musical’s domestic haul to more than $106 million. Lionsgate expanded the number of theaters that “La La Land” was playing in after it received all the awards love.

The Weinstein Company’s “Gold” collapsed at the box office, eking out $3.5 million to be the worst wide-release opening of Matthew McConaughey’s career.

Overall ticket sales were essentially flat with the same weekend last year — a period when “Kung Fu Panda 3” bowed to $41.3 million. Next weekend brings “Rings,” a horror film sequel, and “The Space Between Us,” a science-fiction romance.