Lexmark International Inc. agreed to be sold to a group of buyers including China-based Apex Technology Co. and Asia-focused PAG Asia Capital for $2.54 billion.

The companies said the deal—which pays Lexmark $40.50 a share, a 17% premium to the closing price Tuesday—had an enterprise value of about $3.6 billion when including Lexmark’s debt.

The...