Target said online sales grew 41 percent during the second quarter. (Craig Lassig/Shutterstock) (CRAIG LASSIG/EPA-EFE/REX/Shutterstock/Craig Lassig/Epa-Efe/Rex/Shutterstock)

Target on Wednesday joined a wave of big-name retailers in posting strong quarterly sales, as price-conscious consumers stocked up on toys, electronics and home goods.

The Minneapolis-based chain said the 6.5 percent increase in comparable sales — a closely watched measure of online sales as well as sales at stores open at least one year — was the highest in 13 years, as customer traffic rose to “unprecedented levels.” But Target also benefited from the bankruptcy and store closures of some of its competition. Online sales, meanwhile, rose 41 percent.

Analysts and executives attributed the retailer’s strong earnings to rising consumer confidence. The unemployment rate remains at its lowest level in years, and recent tax cuts have translated into higher take-home pay for many Americans, helping boost sales for some of the country’s largest retailers, including Walmart, Home Depot and Nordstrom.

“There is no doubt that, like others, we’re benefiting from a strong consumer environment — perhaps the strongest I’ve seen in my career,” Brian Cornell, Target’s chief executive, said in a Wednesday earnings call with analysts.

But others pointed out that many of the gains have so far been concentrated among lower-priced retailers. TJX Companies, which oversees TJ Maxx and Home Goods, said this week that second-quarter profits rose 34 percent, while sales grew 12 percent. Walmart, meanwhile, posted a 4.5 percent increase in same-store sales, which helped lift the company’s stock as much as 11 percent last week.

“The customer is showing up to stores and they’re certainly showing up online, but they’re trading down in price,” said Mark Cohen, director of retail studies at Columbia Business School and the former chief executive of Sears Canada. “Unemployment is very low, but underemployment continues to be an issue. Wages are stuck.”

As a result, he and others said, Americans are increasingly spending their money at chains like Target that promise value and convenience.

But not all retailers have gotten a boost. Lowe’s on Wednesday said it would close all 99 of its Orchard Supply Hardware stores as well as a California distribution center following a 7 percent decline in second-quarter profits. The closure of Sears, Kmart and Toys R Us stores around the country have also helped drive store traffic to Target.

Analysts said efforts by Target and Walmart to offer more fresh groceries and curbside pickup have helped draw shoppers that might otherwise have purchased goods online.

Target has also been able to tap into new and growing markets with the launch of exclusive brands like Wild Fable and Original Use, which specialize in trendy clothing for 20-and 30-somethings, and Hearth & Hand with Magnolia, a home decor line by television personalities Chip and Joanna Gaines. It is also remodeling hundreds of stores and so far this year has opened a dozen smaller-format locations near college campuses to appeal to cash-strapped students.

“Consumer sentiment is up, but if you dive underneath that, there is a degree of uncertainty about how grounded this economic growth really is,” said Neil Saunders, managing director of GlobalData Retail. “People are saying, how long will this last? Am I going to lose my job? Because of that, a lot of their spending has been focused on lower-priced and discount stores.”

At Target, executives said the company had benefited from the closure of nearly 800 Toys R Us and Babies R Us stores this year, which helped drive up demand for toys and other children’s items. Sales of baby apparel rose nearly 20 percent in the most recent quarter, with much of that growth coming from the company’s private-label brands.

“Given the strong affinity between families with young children and our brands, toys and baby are key categories for us,” Mark Tritton, Target’s chief merchandising officer, said in the earnings call. “The momentum we’re seeing across our business is amazing, and we can’t point to any one single driver.”

But executives also cautioned that looming tariffs and a possible trade war with China could put a damper on coming growth.

“As a guest-focused retailer, we’re concerned about tariffs because they would increase prices on everyday products for American families,” Cornell said. “In addition, a prolonged deterioration and global trade relationships could damage economic growth and vitality in the United States.”

Overall, second-quarter profits rose 19.1 percent to $799 million from $671 million a year earlier. Revenue, meanwhile, increased 6.9 percent to $17.8 billion.

Shares of Target rose about 3 percent on Wednesday, to close at $85.94 each. So far this year, the company’s stock is up more than 23 percent.

Read more:

Retailers are marketing directly to kids shopping on their smartphones

Playskool crayons found to contain asbestos, advocacy group says

Is soda over? Pepsi to buy seltzer-maker SodaStream for $3.2 billion.