Disney/Pixar’s “Inside Out” has edged Universal’s “Jurassic World” at the three-day Independence Day holiday box office with $29.8 million in the U.S. — reversing estimates that had placed the dino thriller in first.

The fourth weekend of “Jurassic World” wound up with $29.2 million for the Friday-Sunday period, ending its three-week stay in first place. Paramount’s “Terminator Genisys” finished a close third with $27 million, while Warner Bros.’ “Magic Mike XXL” lagged behind with $12.9 million.

“Inside Out” also won the five-day period, starting Wednesday, with $45.1 million at 4,148 locations — giving it $245.9 million Stateside in its third week at 4,158 locations.

“Jurassic World,” starring Chris Pratt and Bryce Dallas Howard, stomped its way to $42.1 million at 3,737 screens, and ranks as the fourth-highest grossing domestic grosser of all time with $566.5 million.

“Terminator Genisys” took in $42.5 million for the five days and has grossed $85.5 million in its overseas launch.

The stripper sequel “Magic Mike XXL” wound up with $27.8 million from 3,355 sites in five days. The performance was front-loaded with $15 million in its first two days. But with a budget of just $14.8 million, “Magic Mike XXL” is already in the black for the studio.