“Finding Dory” dominated the Independence Day box office, overcoming a trio of new releases to provide the weekend’s biggest fireworks.

The Pixar release swam to the top of the charts for the third consecutive weekend, picking up $41.9 million to bring its domestic total to $372.2 million. The follow-up to “Finding Nemo” should end the four-day holiday with another $50.5 million in receipts. It is on pace to surpass “Toy Story 3” and its $415 million haul as the highest-grossing Pixar film in history on a domestic basis.

“It’s showing no signs of slowing down,” said Dave Hollis, distribution chief at Disney, Pixar’s parent company. “As people are weighing what to see, it stands out as the only option that’s going to entertain everyone.”

The July 4th weekend is traditionally one of the movie business’ biggest, but this national holiday suffered from a weak crop of new releases, as costly adventures such as “The Legend of Tarzan” and “The BFG” failed to excite audiences. The influx of new releases did lift industry-wide grosses, and the weekend should be among the five biggest.

“There’s a lot of product out there,” said Paul Dergarabedian, senior media analyst at comScore. “That leads to a lot of fragmentation and cannibalization, and a lot of spreading the wealth.”

With a smaller budget, “The Legend of Tarzan” might rank as a hit. But Warner Bros. and Village Roadshow spent lavishly to update Edgar Rice Burroughs’ jungle king stories, shelling out a reported $180 million to produce the picture and millions more to market it.

Despite the high costs, the film did better than projected, earning $38.1 million for the three-day weekend to take second place. It should make $44 million for the holiday, roughly $10 million more than analysts expected it would generate, but that may not be enough to cover the massive budget. David Yates, who directed several Harry Potter installments, was behind the camera on the film, with Alexander Skarsgård donning Tarzan’s loincloth and Margot Robbie serving as his Jane.

To make a profit, the film will have to resonate with foreign crowds. In its first weekend of international release, “The Legend of Tarzan” pulled in $18.8 million from 19 markets, including South Korea and Russia.

“You have to look at the whole worldwide results,” said Jeff Goldstein, Warner Bros. distribution executive vice president, noting that the film has yet to open in major territories such as China.

“At the end of the day we always looked at this as a bigger play internationally,” he added.

The weekend’s biggest disaster was Disney’s “The BFG,” Steven Spielberg’s $140 million adaptation of Roald Dahl’s classic children’s book. The story of a friendly giant (Mark Rylance) who befriends an orphan (Ruby Barnhill), got solid reviews, but was overshadowed by “Finding Dory.” It collapsed at the box office, eking out $19.6 million over the weekend and should earn a paltry $23.6 million over the four-day holiday for a fourth place finish. It will rank as one of the biggest flops of the summer and of Spielberg’s career, raising questions about his drawing power after a decade spent making historical dramas such as “Lincoln” that are geared at older crowds.

Disney’s Hollis acknowledged the studio was disappointed with the results, but hopes that the film would get a lift in the coming weeks as families seek out entertainment options to keep children occupied during their summer vacations.

“We’ve seen the way people are speaking of and rating the film,” he said. “We’re hoping to be the beneficiary of some good word-of-mouth.”

One new release did score with audiences. Universal’s “The Purge: Election Year” debuted in third place to $30.9 million and should make $34 million over the holiday. That’s a solid return for a film that cost a mere $10 million to produce and another summer success for Blumhouse, the micro-budget purveyor of “Insidious” and “Paranormal Activity.” The two previous installments, “The Purge” and “The Purge: Anarchy,” debuted to $34.1 million and $29.8 million, respectively.

James DeMonaco, who directed the other two Purge films, returned behind the camera, with Platinum Dunes co-producing the project. The sequel follows a presidential candidate (Elizabeth Mitchell) campaigning to end the purge, a legally sanctioned night of lawlessness. It may have benefited from interest in the White House battle between Donald Trump and Hillary Clinton.

In a summer where sequels such as “Alice Through the Looking Glass” or “X-Men: Apocalypse” have struggled to entice audiences, the third “Purge” bucks the trend.

“The magic of the Blumhouse model is that it allows us to be subversive and think outside the box when it comes to interesting audiences,” said Nick Carpou, Universal’s domestic distribution chief.

He credits an off-kilter marketing campaign, where spots for the latest “Purge” ran in conjunction with the presidential primary debates, with driving interest in the picture.

In its second weekend of release, Fox’s “Independence Day: Resurgence” rounded out the top five, earning $16.5 million. The follow-up to the hit alien invasion thriller has made $76.3 million domestically and should close the holiday with more than $20 million in receipts.

On the art house front, A24 expanded “Swiss Army Man,” from three theaters to 636, where it earned $1.4 million. The comedy about a suicidal man (Paul Dano) who befriends a farting corpse (Daniel Radcliffe) drew a mixed response at this year’s Sundance Film Festival, prompting some walkouts. The publicity, however, appears to be helping the film cut through the clutter, in addition to inspiring countless articles about Radcliffe’s flatulence.