The second-half rally that Target Corp. executives hoped for did not materialize during the holidays, as department stores and other traditional retailers continued to see online retailers such as Amazon.com eat away at their business.

The Minneapolis-based retailer said Wednesday that holiday sales were weaker than expected, leading the company to lower its sales and profit guidance for the fourth quarter. Target's shares fell 6 percent.

It was a rough year for Target CEO Brian Cornell's transformation efforts, which have included selling the Minneapolis-based company's pharmacies to CVS, launching new private-label brands and improving its grocery department. Store traffic and same-store sales have been on the decline since last spring — trends that continued into the holidays despite Target's redoubled efforts on promotions and in-store displays.

Target's online sales grew 30 percent in November and December, but they did not make up for lost ground in stores.

And since online sales cost retailers more in terms of shipping costs, they also contributed to an erosion of its profit margins.

"While we significantly outpaced the industry's digital performance, the costs associated with the accelerated mix shift between our stores and digital channels and a highly promotional competitive environment had a negative impact on our fourth-quarter margins and earnings per share," Cornell said in a statement.

Black Friday sales were also strong, he said, but that was offset by softness earlier in the season.

Electronics and food, which Target blamed for weaker sales during the spring and summer, continued to see sales declines during the holidays.

Scott Mushkin, an analyst with Wolfe Research, said in a research report that Target needs to fix its grocery area because it seems to be losing momentum.

"We believe that Target will need to decide whether to stay in the grocery business or exit the category as the company's offering is clearly not resonating enough with consumers," he wrote. "Given Amazon's push into consumables and the further encroachment of the deep discounters in the U.S., it is more likely that the competitive landscape in the U.S. grocery business becomes even more challenging than it is currently."

Target's disappointing scorecard comes on the heels of a string of other disappointing holiday results from major retailers such as Macy's, Sears and Kohl's.

On Tuesday, Toys 'R' Us said same-store sales declined 2.5 percent during the holidays.

Still, the National Retail Federation said overall holiday retail sales rose 4 percent.

Target's comparable sales in November and December dropped 1.3 percent. In-store traffic slid 1.7 percent.

The company said it expects comparable sales in the full fourth quarter to now be in the range of down 1 to 1.5 percent. Its previous forecast was for sales in the range of up 1 percent to down 1 percent.

It also expects adjusted earnings per share in the range of $1.45 to $1.55, lower than its previous guidance of $1.55 to $1.75. Target will report its full quarterly results at its annual investors meeting in New York on Feb. 28.