Aug 2 (Reuters) - IT solutions provider CDW Corp beat second-quarter revenue and profit estimates on Wednesday, as strength in its biggest unit that caters to governments helped offset lower spending from smaller businesses and corporates.

The public segment — which caters to governments, including the U.S., and non-profit healthcare organizations — reported a 2.3% rise in net sales during the quarter, and was the only business to grow over the year earlier.

CDW remains "well-positioned to attain our target of exceeding U.S. IT market growth by 200 to 300 basis points on a constant currency basis", said Chief Executive Officer Christine Leahy.

As macroeconomic fears abate, the company is also relying on higher orders and spending from healthcare and education sectors.

CDW could also benefit from higher demand for hardware required to support AI initiatives at its clients especially in the U.S, which accounts for more than 90% of its revenue.

The company, which provides IT solutions to tech giants such as IBM and Microsoft, reported adjusted profit of $2.56 per share in the quarter ended June 30. Analysts on average estimated $2.33 per share, according to Refinitiv data.

CDW's net sales were $5.63 billion, compared with analysts' expectations of $5.38 billion. (Reporting by Akshita Toshniwal; Editing by Shilpi Majumdar)