It’s hard to think of the world’s largest retailer as an underdog in anything. But when it comes to serving customers looking for a quick, convenient shopping trip for everyday items, that’s exactly what Wal-Mart Stores WMT is.

Once again, the retailer announced tepid U.S. quarterly sales numbers on Thursday, with fewer shoppers coming into its namesake superstores and cutting back on spending when they did go in.

So the world’s largest retailer thinks it has found the solution to kickstart its U.S. sales: its fleet of smaller stores it hopes will win back shoppers from aggressive rivals like Dollar General DG and Dollar Tree DLTR that in recent years have deftly swooped in on Wal-Mart’s turf and attracted lower-income consumers. It is also betting the small stores will help it win more business in urban and rural areas where there is no space or not enough of a market for a big Walmart supercenter.

These smaller-format stores generate only a tiny fraction of Wal-Mart’s U.S. sales so far, but CEO Doug McMillon was quick to tout them in a pre-recorded call to discuss the retailer’s second-quarter numbers, mentioning their strong performance at the very start of the call.

He has a point. Comparable sales at the 400 or so smaller-format stores rose 5.6% compared to a year earlier, with shopper visits rising 4.1%. Meanwhile, at the 3,288 Walmart supercenters, comparable sales declined and traffic fell 1.1%. Wal-Mart’s U.S. problems have been going on for some time, with many analysts calling the supercenter format passé. To remedy that, in February, the store announced it was doubling the number of small stores it had initially planned to open this year. Wal-Mart is in the process of opening between 270 and 300 new small stores, including about 90 Walmart Express stores, this fiscal year, and is spending an extra $600 million to do so.

Most of the new stores will open in the last quarter of the year. The Neighborhood Markets stores, the first of which was opened in 1999, are typically 40,000 square-feet, or about one-fifth the size of a superstore, and have a big focus on groceries, which generate more than half of Wal-Mart’s total U.S. revenues. The Walmart Express stores, a newer and smaller format at about 12,000 square feet per store, function very much like convenience stores and offer items such as meats, dairy and pharmacy products.

“I think convenience is where the consumers have been looking,” Wal-Mart Chief Financial Officer Charles Holley said on a call with reporters after the quarterly results were released.

The retailer is planning to add “gas bars” to many of the Neighborhood Markets stores, with the goal of winning shoppers that need to pop in mid-week to get a carton of milk or some pasta and fill up on gas without having to go into a big-box store. What’s more, selling gas is a way to get shoppers to come by more regularly and is also something online retailers can’t match.

“They’re trying to go into markets they can’t go with a supercenter since not enough people in those markets– they know they’re losing share to dollar stores for the intra-week fill-in trips,” said Edward Jones analyst Brian Yarbrough told Fortune, calling the strategy sound but not risk free as it could cannibalize sales from the supercenters.

Wal-Mart’s accelerated push into smaller format stores comes as dollar stores continue to expand—Dollar General, Dollar Tree and Family Dollar Stores (which Dollar Tree is in the process of taking over Family Dollar in an $8.5 billion deal) operate a combined 24,000 or so stores now, up 23% in just 4 years. And Target TGT is beginning to ramp up its own fleet of smaller, urban stores, though its store count is still negligible for now. Meanwhile, drugstore chains like Walgreen WAG and CVS CVS are expanding their food selection.

So Wal-Mart stands to lose a lot if it doesn’t jump in now.

Still, with only about 700 stores in operation by year-end, the small format locations won’t make much of a dent on Wal-Mart’s anemic comps for a while, Holley acknowledged. And despite this focus on Neighborhood Markets and Walmart Express stores, the retailer has no plans to start shrinking its supercenter fleet.

“Supercenters still have one of the highest returns of any [store] format,” Holley said in response to a question from Fortune. “It would be silly to close a lot of stores with good returns.”