HP Inc. reported strong earnings and gave an upbeat outlook, aided by office reopenings and an expectation for healthy consumer demand through the holiday shopping season despite supply shortages.

The PC and printer maker on Tuesday said it generated quarterly sales of $16.7 billion, up 9.3% from the year-ago period, and $3.1 billion in net income, including a one-time $1.78 billion legal settlement. The results beat Wall Street expectations for both sales and earnings.