Warren Buffett's Berkshire Hathaway has sold another large piece of its stake in IBM, backing further away from an investment that the billionaire has admitted was not one of his best. 

Berkshire cut its 32% stake in IBM in the third quarter to about 37 million shares worth $5.37 billion from 54.1 million shares worth $8.32 billion.

This is according to a regulatory filing detailing its US-listed stock holdings. 

The IBM share stake has fallen by 54% since the end of 2016, when Berkshire owned roughly 81 million shares for which it paid about $13.8 billion. 

During the quarter, Berkshire also boosted its stake in Apple to 134.1 million shares worth $20.7 billion, and became Bank of America's largest shareholder by exercising warrants for 700 million shares. 

IBM accounted for most of the stock sales that Buffett and his deputies Todd Combs and Ted Weschler made in the quarter. 

In May, Buffett revealed he had begun selling IBM, telling CNBC he did not value Big Blue as highly as he did six years earlier when he started buying. 

"IBM is a big strong company, but they've got big strong competitors, too," he said. 

The IBM investment had been viewed as a surprise, given the 87-year-old Buffett's resistance to investing in technology companies and businesses he found harder to understand. 

Berkshire has said it paid an average of about $170 per share for IBM.

For the third quarter, Berkshire also reported lower stakes in Wells Fargo and cable TV company Charter Communications, and higher stakes in seed company Monsanto and credit card issuer Synchrony Financial. 

It also no longer reported a stake in Wabco Holdings, which sells brake and suspension systems for commercial vehicles. 

Berkshire is one of Wells Fargo's largest shareholders, with a nearly 10% stake. 

In April, it withdrew a Federal Reserve application for permission to exceed that level, citing restrictions on its ability to do business with the bank.