MERRIMACK — Information technology services provider Connection’s profits rose by nearly a third in the second quarter, driven by strong hardware sales to big businesses and government as well as strong margins on the sale of cloud-based technologies.

The Merrimack-based company with offices in Keene reported quarterly sales of $741 million, a 5 percent increase over the same quarter last year, resulting in record net income of $23.7 million, or 89 cents a diluted share — increases of 30 and 31 percent respectively.

For the first half of the year, sales went up 3.2 percent to $1.374 billion, and income went up to 23.3 percent to $36.4 million, or $1.37 a share.

The company now has $912 million in assets, up over $105 million compared to the start of the year, and stockholder equity is up $560 million, a $35 million hike. Cash is nearly $70 million, down by more than $30 million. The company did repurchase almost 66,000 shares of stock for $2.2 million.

Connection, which started as a computer catalog company for individuals and small businesses under the name PC Connection, now mainly caters to large businesses, which make up about 43 percent of its sales, compared to 37 percent to smaller business and 20 percent to government.

Notebooks, laptops and phones sales to large businesses (the enterprise sector) jumped nearly $30 million, and desktops and servers another $20 million.

Sales to government entities increased by 12.2 percent to $152 million, but federal sales went up 21.5 percent while state, municipal and educational sales rose 8.8 percent.

But high margins generated by increased sales of cloud based and security software also contributed to the company’s profitability, even though revenue recognition rules meant that they were a drag on the company’s sales growth.

While not giving guidance, Connection predicts continued growth, having built up inventory for several large projects. It is hearing about “some pullback” from large corporations, “but that hasn’t really affected us,” CEO Tim McGrath said in an Aug. 2 earnings call, transcribed by

As for the trade war, the latest round of escalations could have an impact, McGrath said.

“If the tariffs affect our suppliers and our customers, we are impacted.” But he added that the company’s previous concern were “overblown.”