Media playback is unsupported on your device Media caption Trump announces 'amazing' growth - and promises to go higher

The US economy grew at its fastest pace in nearly four years in the second quarter, expanding at an annualised rate of 4.1%, official figures show.

The gains were driven by strong consumer spending and a surge in exports as firms rushed to beat new trade tariffs.

US President Donald Trump described the acceleration as "amazing", claiming it as proof his policies are working.

But many analysts cautioned that growth could cool in coming months.

"In one line: Looks great; won't last," wrote Ian Shepherdson, chief economist at Pantheon Macroeconomics.

What boosted growth?

Friday's report from the Commerce Department showed consumer spending rose by 4% in the second quarter, up from the 0.5% rate seen in the previous three months.

Exports also grew by more than 9%, the fastest rate since the fourth quarter of 2013.

Economists say that figure, which contributed more than 1% to the GDP gains, was inflated in part by farmers seeking to get ahead of new trade tariffs on items such as soybeans.

In July, the US and China imposed tariffs on $34bn of the other country's goods. Canada, Mexico and the European Union also imposed new duties in recent weeks on some US exports in retaliation for US tariffs on steel and aluminium.

Is this "amazing"?

The US economy expanded at an average annual growth rate of 2.2% between 2012 and 2017.

That pace has picked up more recently after a long stretch of job gains that has driven unemployment to near record lows.

President Trump said the White House had to "do a lot of things" to get the economy going again.

He pointed to new tax cuts, de-regulation, increased government spending and the continuing trade negotiations.

"We've accomplished an economic turnaround of historic proportions," he said.

While Friday's report showed the US economy accelerating, the gains were in line with analyst forecasts - and were not out of proportion with some quarters in previous years.

In 2014, for example, the economy rose at an annual rate of 5.1% in the second quarter and by 4.9% in the third quarter.

Compared with the second quarter of 2017, the economy grew by 2.8% in the April-June period.

What's the outlook?

President Trump has said he wants to see GDP growth rise to 3% or more for 2018.

"This isn't a one time shot," he said on Friday. "I happen to think we're going to do extraordinarily well in our next report."

The US hasn't seen full-year GDP growth of more than 3% since 2005, but economists say the rate is within reach this year, due in part to increased government spending, and a $1.5 trillion tax cut that has given businesses and households more money to spend.

PNC Bank is forecasting growth of 3.1% in 2018 - assuming that trade tensions dissipate.

"If the US and its partners do implement substantial tariffs and other trade barriers, US economic growth is likely to be much weaker than this baseline forecast," chief economist Gus Faucher wrote.

After next year, many economists expect growth rates to subside again, as the boost from tax cuts and federal spending dissipates.

What else is notable?

Friday's report revised the estimate for GDP growth in the first quarter to 2.2%, up from 2%.

It also showed that inflation, which has been lacklustre in recent years, rose by 2% according to the Fed's preferred measure, which is tied to consumer spending, except on food and energy.

That is the second quarter in a row the measure, known as core PCE, has hit or exceeded the Fed's 2% target, and is likely to keep the central bank on track with its plans to raise interest rates gradually.

There were some signs of softness, however.

Investment in housing, for example, declined by 1.1%, following a 3.4% fall in the first quarter.

That weakness is a potential red flag, said Lindsey Piegza, chief economist at Stifel.

"Overall, there are clearly a number of factors suggesting the economy is firmly on a solid - albeit far from robust - footing, at least for now," she said.

However, she said the trends in the housing market, as well as the one-off boost in exports in the most recent quarter, call "into question the sustainability of above-trend topline growth looking out to the second half of the year."

Analysis

By Rob Young, BBC business reporter

Media playback is unsupported on your device Media caption Donald Trump loves his economic numbers

Donald Trump tweeted earlier this week that the US has "the best financial numbers on the Planet".

That's not quite the case and it should be said that these first estimates of economic growth are based on skimpy data. But today's economic data is certainly good, and the president can take some of the credit.

His large package of tax cuts has boosted growth. Perversely, so did the threat of various trade rows. Just before Beijing's retaliatory tariffs against the US started at the beginning of July, US soybean exports to China skyrocketed.

This is the first time since the 2016 election that US growth has hit the 4% target President Trump set himself during the campaign.

The latest growth number is twice what it was in the first quarter. But economists warn it's unlikely to last.

There are worries that America's numerous trade spats are now hitting economic growth. So what helped the economy in the first half of the year may well hurt it in the second half.

Is the US economy working for you?

We want to hear your stories about how the economy is doing where you live.

Do you run a business that's hiring more people?

Were you unemployed but have found a job?

Are your wages keeping up with the cost of living?

Email us at AskAmerica@bbc.co.uk and check out the Ask America index to find other untold stories about the US.