(Reuters) - Target Corp TGT.N raised its quarterly profit and sales forecasts on Tuesday on the back of surging online sales and customer visits in November and December, putting the U.S. retailer on track for the best quarter in five years.

The Minneapolis-based chain, whose shares closed up 3 percent at $69.14, raised its fourth-quarter profit forecast to $1.30-$1.40 per share from an earlier range of $1.05-$1.25.

That was well above analysts’ average forecast of $1.22 per share, according to Thomson Reuters I/B/E/S.

Target is slated to have poured $1 billion of last year's profits into an effort to boost sales, mainly by investing in online business and delivery options to take on Amazon.com Inc AMZN.O.

It has hired more staff, remodeled existing stores and focused on building small-format stores to reach more customers in suburbs.

On Tuesday, the company said same-store sales rose 3.4 percent in November and December and that its online sales growth was on track to report its fourth straight year of more than 25 percent gains.

“Target’s brick-and-mortar customers are growing in their affinity to the Target online interface, pricing on hot products in the fourth quarter and the ability to deliver in time,” Jim Fosina, chief executive of Fosina Marketing Group, said.

FILE PHOTO: A newly constructed Target store is shown in San Diego, California May 17, 2016. REUTERS/Mike Blake/File Photo

The lack of strong retail and online players who sell both toys and electronics is likely to have helped the company keep its loyalists away from Best Buy Co Inc BBY.N or bankrupt Toys R Us, Fosina said.

Target raised its same-store sales growth forecast for the quarter ending January to 3.4 percent, from a prior forecast of flat to up 2 percent.

Research firm Retail Metrics’ President Ken Perkins said that, if that target were met, it would be the company’s strongest quarterly gain since the first quarter of 2012.

Target’s is the latest in a run of relatively upbeat holiday sales numbers from brick-and-mortar retailers who have suffered most from the huge gains made by Amazon and other online retailers over the past decade.

Department store chain Nordstrom Inc JWN.N late on Tuesday reported a 1.2 percent rise in comparable store sales for November and December, helped in part by growth in online sales.

The upscale retailer also lifted the low end of its full-year earnings per share forecast by 5 cents to $2.90, keeping the top end unchanged at $2.95.

Shares of department store chain Kohl's KSS.N on Monday surged after it reported a 6.9 percent rise in same-store sales for the same months.

Target said same-store sales in November and December gained in all five of its core merchandise categories: home, apparel, food & beverage, hardlines and essentials.

Kitchen items from brands like Threshold, KitchenAid and Keurig, and cordless vacuums from Roomba and Dyson were popular gifting items.

An exclusive furniture and household goods brand, co-designed by TV personalities Chip and Joanna Gaines, was also a hit after launching in November, the company said.

Target’s fourth-quarter profit forecast includes a 6 cent to 8 cent benefit from the newly approved reduction in Federal corporate tax rates.