Walmart wmt has proven it won’t give up its market share without a fight.

Last month, the retailer reported a 1.6% increase in U.S. comparable sales in the second quarter—a number head and shoulders above Target tgt , Dollar General dg , and Dollar Tree dltr .

The reasons for the success are many: Walmart threw competitors off by aggressively cutting back prices; worker pay raises helped lift the retailer’s long-languishing customer service score; and multibillion-dollar investments in e-commerce, including its recent purchase of Jet.com, have boosted online sales. Walmart also revamped fresh food areas at thousands of stores and rolled out its own mobile payment app, as well as expanded its online marketplace.

Walmart’s turnaround efforts have landed the company back in Wall Street’s good graces. Cowen & Co. analyst Oliver Chen on Monday raised Walmart’s rating from “market perform” to “outperform,” noting that the retailer is still early on its store upgrades and other projects. The company’s rising fortunes “should continue over the next two years as WMT makes more aggressive price investments [price cuts] and makes further improvements in the customer experience,” Chen said.

 

At the same time, Chen lowered Target’s tgt rating from “outperform” to “market perform.” Since Target saw fewer customers than Walmart last quarter, Chen doesn’t think it can hold its own against Walmart’s price cuts.

“Increasing price competition from Walmart and the convenience of Amazon Prime will make the recent ‘fill-in’ trip weakness for Target persist,” Chen said. Fill-in trips refer to smaller, typically intra-week shopping visits to pick up a few items.

Walmart’s aggressive pricing, particularly in its grocery department where it gets 55% of revenue, has also hit Dollar General hard. The dollar-store chain, which was one of the primary beneficiaries of Walmart’s post-recession woes as shoppers traded down, said last month it would cut prices by about 10% on hundreds of staples like milk and eggs, a move clearly aimed at keeping customers from drifting back to Walmart.

Between June and August, Walmart’s price edge over Dollar General and Family Dollar also grew, according to a new study by Wall Street firm Jefferies. Analyst Daniel Binder reiterated his “buy” rating on the Wal-Mart Stores stock and expects more “price investments” by the retailer in the crucial holiday season.

The upgrades sent Wal-Mart Stores stock up as much as 1.5% on Monday.

Now Target is trying to keep up by lowering its prices on non-grocery items. Last month it held a one-day promotion offering 10% off a total purchase, a nod to executives admission that it had focused on the “Expect More” part of its slogan vs. the “Pay Less” aspect.

That said, Amazon amzn still presents a major challenge for both Walmart and its competitors. Amazon has made big inroads into grocery, among other categories. Chen thinks Walmart, the second-largest online retailer with sales of about $13 billion, has the best chance of standing up to Amazon.

Still, Amazon’s growth has consistently outstripped Walmart’s digital growth, suggesting Walmart is poaching customers from others, not Amazon.

“In our view, Walmart can use its scale to compete on price to regain or maintain market share versus Amazon … but Target cannot compete as easily,” Chen said.