Image caption The summer box office takings have topped $4.1bn (£2.6bn) so far

Hollywood is on course for its biggest ever summer box office in the US despite several high profile flops.

Big budget films The Lone Ranger, Will Smith's After Earth and animation Turbo all hugely underperformed in America.

However figures show studio films have earned $4.1bn (£2.6bn), close to 2011's previous high of $4.4bn (£2.8bn).

Sci-fi Elysium, from District 9 director Neill Blomkamp, topped this week's North American chart earning $30.5m (£19.7m) in its opening weekend.

Starring Matt Damon and South African actor Sharlto Copley, the film had a fairly modest debut after costing $115m (£74.3m) to make.

Elysium matched studio expectations but opened with a lower figure than director Blomkamp's surprise 2009 low-budget hit, which took $37.3m (£24.1m) in its first three days.

Rory Bruer, head of distribution for Sony, said Elysium would be "very profitable", adding "international is going to be the big, big win on this film for us".

North American box office Elysium - $30.5m We're the Millers -$26.6m Planes - $22.5m Percy Jackson: Sea of Monsters - $14.6m 2 Guns - $11.1m Source: Hollywood.com

In a crowded week for new releases, Jennifer Aniston's comedy We're The Millers took the second slot with $26.6m (£17.2m) while Disney animation Planes took $22.5m ($14.5m).

The weekend's takings brought 2013's total box office to $7bn (£4.5bn) so far.

Sci-fi Pacific Rim and Jeff Bridges' action comedy R.I.P.D were other high budget films which left studios disappointed at the box office over the summer.

Chris Aronson, the head of distribution for Fox, admitted 2013 had seen some "high-profile failures," but added, "the summer's been fantastic despite the gloom and doom some in the media have portrayed".

The summer flops have been offset by the success of films such as World War Z - which has crossed the $500m (£323m) global takings mark despite rumoured problems and reshoots - and the doomsday comedy This Is the End, which has made $96m (£62m) - three-times its budget.

Animations Despicable Me 2 and Monsters University also earned huge box office numbers worldwide, taking $746m (£482m) and $637m (£412m) respectively to date.