Sales of previously owned U.S. homes increased in May, a sign of solid demand during the housing market’s spring selling season in the face of fast-rising prices and tight inventory.

Existing-home sales rose 1.1% in May from the prior month to a seasonally adjusted annual rate of 5.62 million, the National Association of Realtors said Wednesday. Economists had expected a modest decline from April. Compared with a year earlier, sales were up 2.7% last month.

“The...