Americans increased their retail spending in July by the most in five months, opening their wallets after a frugal spring and offering hope that the slumping economy may rebound in the second half of the year.

Retail spending rose in every major category, from electronics and sporting goods to furniture, building supplies and garden equipment. The report from the government followed one earlier this month that showed hiring strengthened in July.

Overall retail sales rose 0.8 percent from June to July, the Commerce Department said. It was the sharpest increase since February, and it followed three months of declines.

The stepped-up spending was evident in a flurry of retail earnings reports for the second quarter, which ended in late July.

Home Depot, the nation’s largest home improvement retailer, said healthy sales of paint, bathroom accessories and kitchen installations helped lift its net income 12 percent.

Macy’s raised its annual earnings guidance last week after reporting a 16 percent increase in net income in the second quarter. Macy’s executives specifically cited a pickup in their teen clothing business, which had been weak.

TJX Cos., which sells discounted brand names under such store banners as T.J. Maxx and HomeGoods, said its second-quarter net income jumped 21 percent on better same-store sales.