Warren Buffett’s Berkshire Hathaway Inc.’s may have sold some Apple Inc. shares during the third quarter, but its ownership stake in the technology giant actually increased, as the value of the investment swelled by more than $6 billion.

Apple’s stock AAPL, +1.19%   climbed 0.9% in afternoon trading Friday, which put it on track to close at a record high for th seventh time this month.

In a 13F filing with the Securities and Exchange Commission late Thursday, Berkshire BRK.B, +0.17% BRK.A, -0.09%  disclosed what amounts to a rebalancing of its Apple investment, as the number of shares it owned declined by 750,650 to 248,838,679 shares as of Sept. 30, from 249,589,329 shares as of June 30.

However, because Apple’s shares outstanding declined to 4,443,265,000 from 4,519,180,000 shares, Berkshire’s ownership stake increased to 5.60% from 5.52%.

And since Apple’s stock surged 13% during the quarter, the value of the stock owned by Berkshire increased by over $6 billion, to $55.73 billion as of Sept. 30 from $49.40 billion as of June 30, despite the lower share count.

The value of the holding in Apple represented 26.0% of the total value of Berkshire’s equity holdings, which was $214.67 billion on Sept. 30, compared with 23.7% of the total on June 30.

Apple’s stock has run up 68% year to date, making it the best performer this year of the components of the Dow Jones Industrial Average DJIA, +0.80%  , which has gained 20% in 2019.

Berkshire remained Apple’s second-largest shareholder, behind Vanguard Group Inc., according to FactSet.

Vanguard’s 13F filings showed the fund sold 3,981,157 shares of Apple during the third quarter to lower its holdings to 331,132,509 shares as of Sept. 30, but the stake increased to 7.45% of the shares outstanding from 7.42%.