Image copyright Getty Images Image caption Goldman Sachs chief executive Lloyd Blankfein in Washington in 2012

US investment bank Goldman Sachs has posted its first quarterly loss in six years amid continued troubles in its trading business.

The firm lost $1.9bn (£1.4bn) in the last three months of 2017, as revenue slumped 4% from the prior year.

It also reported a one-time tax charge of $4.4bn, making it the latest major bank to take a hit from changes in the US code.

Bank of America also reported a $2.9bn tax charge but overall profits climbed.

The US passed a sweeping tax overhaul in December, which slashes the corporate rate from 35% to 21% and changes how overseas profits are taxed.

Banks have warned shareholders the changes will lead to steep tax bills in the near term but be beneficial in the long term.

As well as posting a quarterly loss, Goldman's full-year profits fell by more than 40% to $4.3bn.

Some divisions, such as investment banking, did well. But the primary source of the troubles was its struggling fixed income, currencies, and commodities trading business, which saw revenues slide 30% over the year.

In the fourth quarter, revenue in the unit was $1bn, down 50% from the same period in 2016.

Goldman has blamed the problems on unusually calm markets, which can dampen demand from clients looking to take advantage of fluctuation.

Executives have pledged to improve the business, which accounts for a large portion of the firm's overall revenue.

Investors, however, are growing impatient.

On a conference call with the company, Wells Fargo analyst Mike Mayo said: "It just seems like progress should have been a lot faster."

Goldman shares fell almost 3% after the results. Bank of America shares were also lower, falling about 1.5%, despite its stronger performance.

Despite the tax hit, the bank, which has a large consumer-focused business, earned $2bn in profits in the fourth quarter.

Its full-year profit gained almost 3% from 2016 to $16.6bn.