Office Depot Inc. and OfficeMax Inc. are discussing a merger, with a deal possible this week, said a person familiar with the matter. Shares surged for both companies.

The companies have been discussing a potential stock swap that would create a single office-supply retailer to compete with Staples Inc., said the person, who asked not to be identified because the talks are private. Office Depot, the second-largest office-supplies retailer in the U.S., has been exploring options since September, when activist fund Starboard Value LP became its largest shareholder.

A merger would create a company with almost $18 billion in revenue, compared with $25 billion in revenue last year for Staples. A deal also could be a victory for Starboard, which has been pushing Office Depot to create value for shareholders. The shares had declined about 90 percent from a peak in 2006.

Shares of Office Depot surged 9.4 percent to close at $5.02. OfficeMax rose 21 percent to $13.

Office Depot closed at $4.59 on Friday, down from a peak of $44.46 in May 2006. That gave the company a stock-market value of $1.31 billion, more than OfficeMax's value of $932.5 million based on last week's $10.75 closing price.

Starboard Chief Executive Jeffrey Smith wrote a letter to Office Depot CEO Neil Austrian on Sept. 17 arguing that the retailer's "poor operating performance" has hurt the stock. Smith, whose firm owns 13 percent of the chain, recommended smaller stores carrying fewer items. It also should cut general expenses and lower advertising costs, he said.

While Starboard would support the idea of a merger, the firm would need to see terms of the deal before approving anything proposed between the two retailers, said a person familiar with that matter.

Julie Treon, a spokeswoman for Naperville, Ill.-based OfficeMax, wouldn't confirm merger talks.

"There have been rumors for a while about consolidation in the marketplace," Treon said by phone. "It's also been our policy not to comment on market rumors or speculation."

Brian Levine, a spokesman for Boca Raton, Fla.-based Office Depot, declined to comment in an e-mail.

A combination may generate as much as $580 million in cost savings, Daniel Binder, an analyst for Jefferies & Co. in New York, wrote in a note to clients. Both chains have been closing locations and that trend would accelerate with a merger as about 50 percent of their store territories overlap, he said.

The combined OfficeMax and Office Depot may close or sell as many as 600 locations, giving Staples an opportunity to increase sales in those areas, Gary Balter, an analyst for Credit Suisse Group AG in New York, wrote to clients.