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

Berkshire cut its IBM stake 32 percent in the third quarter to about 37 million shares worth $5.37 billion from 54.1 million shares worth $8.32 billion, according to a Tuesday regulatory filing detailing its U.S.-listed stock holdings.

The IBM share stake has fallen by 54 percent 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 Inc 3 percent to 134.1 million shares worth $20.7 billion, and became Bank of America Corp's largest shareholder by exercising warrants for 700 million shares.

IBM, whose full name is International Business Machines Corp, 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. The shares closed up 49 cents at $148.89 on Tuesday, but fell in after-hours trading.

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

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

Berkshire is one of Wells Fargo's largest shareholders, with a nearly 10 percent 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.

(Reporting by Jonathan Stempel in New York; Editing by Lisa Shumaker)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.