(Reuters) - Upscale department store Nordstrom Inc JWN.N saw its shares soar as much as 14 percent in after-hours trading on Thursday, after reporting better-than-expected quarterly same-store sales growth, as more people shopped at its online stores.

FILE PHOTO: The Nordstrom store is pictured in Broomfield, Colorado, U.S., February 23, 2017. REUTERS/Rick Wilking/File Photo

For 2018, the Seattle, Washington-based company expects an adjusted profit of $3.50 to $3.65 per share, compared with its previous forecast of $3.35 to $3.55.

Nordstrom managed to report upbeat results despite the problems in the broader retail sector, which has suffered from fast-changing fashion trends and discount-hungry shoppers who favor buying online.

In large part, analysts said, the results showed Nordstrom successfully boosted online traffic and transactions by promoting blowout sales on social media and making the in-store and online purchasing processes more frictionless for shoppers.

Earlier on Thursday, J.C. Penney Co Inc JCP.N shares sank below $2 for the first time after it said it had alienated core middle-aged customers while chasing millennial buyers, and the venerable brand forecast an unexpectedly large loss.

At Nordstrom, online sales, helped by online promotions, rose 23 percent and accounted for 34 percent of total sales.

“We feel like their inventory doesn’t have a huge overlap with Amazon’s,” Director of Capital Markets at asset management firm Exponential ETFs Josh Blechman said. “Because it is a little bit higher-end, that sort of lets their online offerings to shine more.”

On a conference call with investors, Nordstrom’s Co-President Blake Nordstrom also highlighted the competitive advantage Nordstrom has because of its inventory and product assortment.

“The strength of our inventory position allowed us to be fluid and respond quickly. We took swift action to accelerate inventory turns, strengthen our core assortment and improve our execution in stores.”

Nordstrom’s discount Rack stores, Co-President Nordstrom said, saw the biggest inventory change.

Same-stores sales rose 4 percent in the second quarter ended Aug. 4 across both full-price and off-price, beating the average analyst estimate of a rise of 0.81 percent, according to Thomson Reuters I/B/E/S.

Excluding items, the company earned 95 cents per share, beating estimates of 84 cents, according to Thomson Reuters I/B/E/S.

Net sales rose about 7 percent to $3.98 billion, higher than the $3.72 billion analysts had expected, and boosted by the timing of its Anniversary Sale.