The notion that the U.S. economy could be in imminent danger of falling into recession became a lot less plausible Thursday morning when Walmart reported its quarterly earnings.

Walmart is the largest retailer in the U.S., with $387.66 billion in annual U.S. sales and 5,263 stores. It is also the country’s largest grocer. It arguably has more insight into the U.S. consumer than anyone else, including tech giants and government data bureaus.

The company said sales rose in the second quarter and raised its profits forecast for the year. Investors cheered the news, sending its stock up by nearly 5 percent.

Walmart said it expects U.S.comparable sales to rise at the upper end of a 2.5 percent to 3 percent range for the full year. Earlier it had forecast sales in the middle of that range.

“We still feel good about the consumer overall,” Walmart Chief Financial Officer Brett Biggs said.

That forecast incorporates the latest US tariff plans. The company said that the extension of tariffs would impact many of the goods it sells but it was mitigating the impact on consumers. It did not say it would have to raise prices.

Biggs said Walmart “has been able to thoughtfully manage pricing and margins with both our customers and shareholders in mind.”

“You look at other places to source. Some of that can be done, some of it can’t,” Biggs said Thursday.

“We understand that free trade also has to be fair trade,” Dan Bartlett, executive vice president of corporate affairs, told reporters on a conference call.

Sales at Walmart’s U.S. stores, both brick-and-mortar and online, operating at least 12 months grew 2.8 percent, in part due to strong grocery sales. Online sales rose 37 percent.

That’s a prediction of ongoing consumer strength, defying the gloom and doom predictions that have dominated financial markets in recent days.

The Commerce Department released retail sales data on Thursday that also hurt the argument for a broader slowdown. Sales rose 0.7 percent in July from a month earlier, more than twice what was expected. Sales less autos rose 1 percent, well above the expected three-tenths of a percentage point gain.