The stock was trading up 11% at $71.90.
The Greenwich, Conn., company earned $1.19 a share in the quarter, compared with $1.03 in the year-earlier quarter. Adjusted earnings were $1.28 a share against 98 cents.
A survey of analysts by FactSet produced a consensus second-quarter earnings estimate of $1.04 a share.
Revenue slipped 2.9% to $4.24 billion from $4.36 billion. The FactSet consensus for the period was $4.37 billion.
Chief Executive Bradley Jacobs in a statement attributed the results to XPO keeping costs in line and fattening its profit margins, to offset what he called a "softer operating environment."
XPO is developing tools that use machine learning to enable dynamic pricing, optimization of pickup and delivery routes, and other requirements of the business, Jacobs said.
For all of 2019, earnings before interest, taxes, depreciation and amortization are expected to range $1.68 billion to $1.73 billion, up 7% to 10% from a year earlier. The company had previously expected growth of 6% to 10% for the year.
XPO now expects revenue for the full year to range from down 1% to up 1% from 2018. Its previous expectation was a rise of 3% to 5%.
For all of 2018, XPO reported revenue of $17.28 billion. The updated revenue estimate indicates an estimated range of $17.11 billion to $17.45 billion. The FactSet estimate for all of 2019 is $17.56 billion.
Save 76% with our Summer Break Sale. Subscribe to our premium site Real Money and become a smarter investor! Click here today to sign up!