It took $36.4m (£26.7m), trouncing Melissa McCarthy's latest comedy, Tammy, which took $21.2m (£15.6m).
"This ranks as one of the lowest fourth of Julys ever," said Paul Dergarabedian, from box-office tracker Rentrak.
Takings were down 44 per cent compared to last year.
US Independence Day weekend is traditionally marked by the release of "tentpole" movies - from Back to the Future to Terminator 2 and Men In Black.
Last year's major release was animation Despicable Me 2, which went on to take $368m (£214m), making it the fourth-biggest movie of the year in the US. But this year, there was no major release to coincide with the holiday.
Michael Bay's Transformers, the fourth in the series, has a cast led by Mark Wahlberg.
It has received generally poor reviews from critics, as has Tammy.
The only other major new release was the horror film Deliver Us From Evil, starring Eric Bana. It opened in third place with $9.5m (£6.9m).
The box office will be hoping for a boost next weekend with the release of Dawn of the Planet of the Apes, starring Andy Serkis and Gary Oldman. It is expected to be one of the summer's big hitters.

The Competition and Markets Authority (CMA) applied them in 1989, after fears two firms, taken over by FirstGroup in 1996, could have too strong a bargaining position with the council.
The CMA said it was seeking views from a number of groups.
First Bristol said it "welcomed the decision to review these undertakings".
The company added it had "already assisted" the CMA as part of the review process.
The restrictions were implemented following the 1989 merger of two local bus companies Badgerline and Midland Red West.
The Monopolies and Mergers Commission, at the time, ruled the merger would remove competition for bus services contracted by the former Avon County Council.
The CMA said the merged company was "therefore required to sign up to a number of restrictions".
These included a cap on the amount they could receive from the local authority for running a tendered service - and a requirement to return any excess profit from such services.
The CMA said it was carrying out the review "to see if there has been a change in circumstances which justifies their removal or variation" and was "seeking views" from local authorities, bus operators and bodies representing bus passengers in Bristol and the surrounding area.
It said it aimed to publish the results of the review in the summer.
Transformers: Age of Extinction has held on to the number one spot at the North American box office on an unusually quiet 4 July weekend.
[NEXT_CONCEPT]
Restrictions on bus operator First Bristol, put in place almost 20 years ago, are to be reviewed to "see if they are still appropriate".