Target’s slump was short-lived.

The discount retailer’s shares rose 9% in pre-market trading on Wednesday after it reported a much smaller than expected decline in comparable sales and posted strong e-commerce growth. As a result, Target tgt has raised its full year profit and sales forecast. The retailer’s strong third-quarter performance is contrasted with a weak second-quarter, when it had raised the specter of a weak holiday season.

More encouragingly, as the holiday season gets underway, Target is bringing in more shoppers to its stores. The retailer had been struggling to get shoppers to come to its stores earlier this year and had blamed that in part on the disruption from CVS Health cvs taking over its pharmacy business. But comparable sales, which strip out the impact of recently opened or closed stores, fell 0.2% in the quarter, a result that provided relief to investors who were told in August by Target that they could fall as much as 2%. (Sales fell 1.1% in the second quarter.)

 

 

Wall Street was also bracing for a 1% decline, but Target said it was propelled by a particularly strong back-to-school season.

“We are very pleased with our third quarter financial results, which reflect meaningful improvement in our traffic and sales trends and much stronger-than-expected profitability,” said Target CEO Brian Cornell in a statement.

Since Cornell became CEO in 2014, he has tried to differentiate Target from rivals like Walmart wmt with a sharper focus on product categories like kids and children’s items, wellness and improving Target’s clothing brands. Target said comparable sales in those categories were about 3 percentage points higher than the company overall. And Cornell claimed Target won market share in those areas.

 

The company now expects fourth-quarter comparable sales, which include the key holiday season, to range from a drop of 1% to an increase of 1%, whereas before it had forecast a drop of 2% at most, and flat at best. Target now expects full-year adjusted earnings per share of $5.10 and $5.30, up from a prior forecast of $4.80 to $5.20.

Target’s digital sales rose 26%, re-accelerating after successively smaller increase in recent quarters.