Weaker demand for freight services caused UTi Worldwide Inc.’s profit to fall a worse-than-expected 17 percent in its fiscal second quarter. But the company’s shares rose on Thursday on speculation that the report could have been worse.

The Long Beach shipping and logistics company on Thursday reported net income of $18.9 million (18 cents a share) for the quarter ended July 31, compared with net income of $22.9 million (22 cents) in the same period a year earlier. Revenue fell 11 percent to $1.16 billion, with airfreight revenue down 20 percent and ocean-freight revenue off 4.9 percent.

“The anemic global economy and weak freight environment continued to weigh on results,” Chief Executive Eric W. Kirchner said in a statement. “Clients have become increasingly careful in their freight and logistics spending.”

Adjusted for severance and other items, earnings were 20 cents a share. The Wall Street consensus was for adjusted profit of 23 cents on revenue of $1.30 billion, but investors had been prepared for an even worse report after FedEx Corp. on Wednesday cut its earnings forecast, citing weakness in the global economy.

UTi shares closed up $1.10, or 8 percent, to $14.55 on the Nasdaq.