NEW YORK (AP) — Private equity firm Sycamore is buying office supplies chain Staples for $6.9 billion.

The companies said Wednesday that shareholders of Framingham, Massachusetts-based Staples will get $10.25 per share.

Staples stock had closed Wednesday up 77 cents, or 8.4 percent, to $9.93 on a late-afternoon report of a deal. The stock rose 1.5 percent in after-hours trading.

Changing shopping patterns, like the shift to online buying, have hurt office-supplies megastores like Staples. Reports back in April said the chain was in deal talks, less than a year after it dropped a $6.3 billion merger with rival Office Depot because of opposition from antitrust regulators.

The companies said they expect this deal to close by the end of the year.