(Reuters) - Target Corp TGT.N reported higher-than-expected quarterly profit and sales and set an optimistic tone for the year, saying its full-year profit could come in at the higher end of its forecast.

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

Target’s shares rose 3 percent on Wednesday as the outlook allayed some investor concerns following the company’s warning just three months ago that its full-year targets were too high.

The company has been trying to turn around its business for several years and in February vowed to aggressively promote its products and keep grocery prices low to better compete with Wal-Mart Stores Inc WMT.N and Amazon.com Inc AMZN.O.

Target is also focusing on opening smaller-format outlets and is investing heavily in its e-commerce business.

The company’s online sales rose 22 percent in the first quarter, with the retailer shipping more than 27 percent of those orders from its stores.

Target said it invested $500 million as part of its turnaround strategy in the first quarter, and was on track to invest more than $2 billion this year on analytics, supply chain and opening 100 more small-format stores in urban neighborhoods and college markets.

Some analysts, however, were not impressed by these efforts.

“Q1 does not show signs of major investments, nor does Q2 guidance,” Morgan Stanley analyst Simeon Gutman wrote in a note.

Gutman, noting a marginal decline in gross margins, said the investments do not seem meaningful for a retailer that has touted “systemwide price investments” and is experiencing a higher mix of online sales.

Gross margins fell to 30.5 percent from 30.9 percent.

On a post earnings call with analysts, Chief Executive Brian Cornell said it would take time for turnaround to take hold. “Our results are not where we want them to be,” he said.

Sales at Target stores open at least a year fell 1.3 percent in the first quarter, rounding up a year of same-store sales declines. Analysts had expected a 3.6 percent decline, according to research firm Consensus Metrix.

A rise in demand for swimwear and electronic items such as the Nintendo Switch gaming console as well as the strong performance of its smaller-format stores helped the company beat Wall Street’s muted profit and sales estimates.

Excluding items, Target earned a profit of $1.21 per share, while revenue fell 1.1 percent to $16.02 billion.

Analysts on average had expected earnings of 91 cents per share on revenue of $15.62 billion, according to Thomson Reuters I/B/E/S.

Target said the higher-than-expected performance in the first quarter had increased the probability that its full-year results would come above the midpoint of its prior forecast for adjusted profit of $3.80-$4.20 per share.