NEW YORK – Books and bits united Monday as Microsoft provided an infusion of money to help Barnes & Noble compete with top electronic bookseller Amazon. In exchange, Microsoft gets a long-desired foothold in the business of e-books and college textbooks.

Microsoft Corp.’s $300 million investment sent Barnes & Noble Inc.’s stock zooming up $7.07, or 52 percent, to $20.75 at the close of trading Monday. The opening price of $26 was a three-year high. Microsoft’s stock rose 2 cents to $32.

The two companies are teaming up to create a subsidiary for Barnes & Noble’s e-book and college textbook businesses, with Microsoft taking a 17.6 percent stake.

The deal gives Barnes & Noble ammunition to fend off shareholders who have agitated for a sale of the Nook e-book business or the whole company, but the companies said Monday that they are exploring separating the subsidiary, provisionally dubbed “Newco,” entirely from Barnes & Noble. That could mean a stock offering, sale or other deal.

The deal also puts to rest concerns that Barnes & Noble doesn’t have the capital to compete in the e-book business with Amazon.com Inc. and its Kindle, said analyst David Strasser at Janney Capital.

For Microsoft, the investment means that it will own part of a company that sells tablet computers based on Google Inc.’s Android, one of the main competitors of Windows Phone 7, Microsoft’s smartphone software.

Microsoft also said the deal means that there will be a Nook application for Windows 8 tablets, set to be released this fall. The app is likely to get a favored position on Windows 8 screens.

There’s already a Nook application for Windows PCs, but none for Windows phones.

William Lynch, the CEO of Barnes & Noble, said Nook software will continue to be available on devices like the iPhone that compete with Windows Phone.

The Nook has pleasantly surprised publishers, who worry about Amazon.com’s domination of the e-market. Unveiled to skeptical reviews in 2009, the Nook is estimated to account for about 25 percent of the U.S. e-book market. The Nook helped to cut Amazon’s share from what was believed to be 90 percent to around 60-65 percent. David Pogue in The New York Times called the initial device “an anesthetized slug,” but praised the new Nook Simple Touch as a “very big deal” that offers “spectacular, crisp pages to read in any light.”

Amazon.com had been offering top-selling e-books for $9.99, a cost that publishers, agents and writers believed was so low it could drive competitors out of business. Three of the five publishers sued — Simon & Schuster, HarperCollins and the Hachette Book Group — have already agreed to settle, meaning prices for their e-books likely will again drop on Amazon.