In this Dec. 11, 2012 file photo, Miguel Mercado unpacks Nook tablets at the Barnes & Noble distribution center in Monroe Township, N.J. Barnes & Noble on Thursday, Dec. 4, 2014 said it is ending its commercial agreement with Microsoft for its Nook e-book reader ahead of its planned Nook spinoff. (AP Photo/Julio Cortez, File)

Bookseller Barnes & Noble said Thursday it is ending its commercial agreement with Microsoft for its Nook e-book reader ahead of its planned Nook spinoff.

The news came as the largest U.S. traditional bookseller reported second-quarter net income that missed expectations.

Barnes & Noble, beset by tough competition from online retailers like Amazon and discount stores like Wal-Mart, said in June that it plans to split off its money-losing Nook e-reader division as it looks to boost shareholder value.

In 2012 Microsoft paid $300 million for a 17.6 percent stake in Barnes & Noble's college bookstores and Nook business. The investment helped support the Nook business and Barnes & Noble supplied Nook content and apps for Microsoft's Windows products. On Thursday Barnes & Noble said it will buy out Microsoft's stake in the business for $125 million.

The company also said the spinoff could occur by the end of August 2015.

Shares of Barnes & Noble fell $1.15, or 5.2 percent, to $21.09 in late afternoon trading. The stock had been up about 30 percent in 2014.