Beleaguered bookseller Barnes & Noble Inc. has a buyer.

Elliott Management Corp. agreed to purchase the chain for $6.50 per share in an all-cash transaction valued about $476 million, plus the assumption of debt, the company said in a statement Friday.

Barnes & Noble shares rose as much as 11% to $6.61 on Friday. They had surged 30% on Thursday on news that Elliott was close to a deal.

Elliott, run by the billionaire Paul Singer, has experience in the book business. It acquired Waterstones, a U.K. book retailer, last year. James Daunt, chief executive officer of Waterstones, will also become CEO of Barnes & Noble. Elliott will keep the chains operating independently but the brands will “share a common CEO and benefit from the sharing of best practice between the companies.”

Including debt, the deal is valued at $683 million, according to the companies. It’ll be funded by a $700 million asset-based revolving credit facility from Wells Fargo Bank and Bank of America, as well as a $125 million first-in, last-out credit facility backed by a Carlyle Group credit unit, a Pathlight Capital fund and Wells Fargo, according to regulatory filings.

The deal also includes a $30 million breakup fee, the filings show.

Barnes & Noble, with more than 600 stores, has tried strategies such as offering food and coffee and selling non-book merchandise, but has failed to stem the onslaught of Amazon.com Inc. Along the way, it’s weathered self-inflicted wounds and internal drama. A big investment in its Nook e-book device -- a competitor for Amazon’s Fire tablets -- was ultimately a bust.

The acquisition will give Barnes & Noble “more leeway to work on a long-term strategy, even if it means pain in the short term,” said Seema Shah, a consumer discretionary analyst for Bloomberg Intelligence. “While this could improve profitability, the competitive landscape as a whole remains tough, so the success of this acquisition will depend on how Elliott can make BKS relevant again so that it can effectively compete with value and online players.”

Despite the relentless competition from Amazon, Barnes & Noble has managed to somewhat stabilize its business over the past few years, with revenue declines narrowing to a drop of 3.1% last year. The retailer still generates cash -- sales were almost $3.6 billion last year -- and the little outstanding debt on its balance sheet isn’t due until 2023. The company has also spent the past few years closing weak stores or moving them to better locations.

“Physical bookstores the world over face fearsome challenges from online and digital,” Daunt said in the statement. “We meet these with investment and with all the more confidence for being able to draw on the unrivaled bookselling skills of these two great companies.”

Chairman Leonard Riggio, the company’s largest shareholder, has entered into a voting agreement in support of the transaction, according to the statement. In October, the company said it was considering a sale to several interested parties, including Riggio. Riggio had previously expressed interest in buying Barnes & Noble but later withdrew.

Waterstones, the U.K.’s last major bookstore chain, had 283 stores at the time of the sale to Elliott.

The retailer returned to profit in 2016 for the first time since the financial crisis -- especially notable given that Britain is one of the world’s most advanced e-commerce markets, with about one-fifth of overall retail sales occurring online. Daunt has moved to keep Waterstones stores relevant in a digital era by establishing them as event spaces and opening in-store cafes.

At a time when most retail chains and online retailers feature standardized selections of merchandise and emphasize price above all else, Daunt encourages shop managers to give shops a distinctive feel by catering to neighborhood consumers’ tastes and featuring their own selections of books. Employees are encouraged to write their own reviews, which are displayed next to the titles.

For the year ended in April, Waterstones reported sales of 386 million pounds ($492 million) and an operating profit of 24 million pounds, according to a filing with the U.K.’s Companies House.