That was more than double the pace recorded in the previous three months, and above estimates of 2.2%.
The rise, helped by an increase in exports, is a further sign that the economy may be getting back on track.
The government had originally estimated that GDP grew at a 1.7% rate in the second quarter.
The revised non-annualized quarter on quarter figure was 0.6%, up from an initial 0.4% estimate.
Housing and business investment, two key sectors of the economy, remained strong in the revised figures.
Housing construction grew at an annual rate of 12.9%, the fourth consecutive quarter of double-digit growth.
Meanwhile, business investment was revised up to a 16.1% rate.
The government also said data from retailers showed they had restocked their shelves at a faster pace in the April-to-June period than first thought.
The positive news could make US central bank economists more likely to begin reducing monthly bond purchases later this year.
The programme is one of the US’s last stimulus measures.
Economists think growth will stay at the 2.5% rate in the second half of the year, boosted by steady job gains and less drag from federal spending cuts.
mjd75N1OpYAThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…