Graham Corp.’s second-quarter profits tumbled by 52 percent, but still easily topped analyst expectations, as the Batavia manufacturer’s customers turned tentative in an uncertain economy.

While Graham’s sales slid by 23 percent during the quarter, company executives said the decline was largely due to a big Middle Eastern refinery project that inflated last year’s revenues but had no impact this year. The lower sales also hurt Graham’s overall profitability because its fixed costs were spread over a smaller revenue base.

“We had some pretty tough comparables, compared with the second quarter of 2011,” said Jeffrey F. Glajch, Graham’s chief financial officer, during a conference call Friday.

Still, James R. Lines, Graham’s president and chief executive officer, said he sees some signs of optimism in the company’s oil refining, petrochemical and power generation markets.

“We are encouraged about order activity,” Lines said. “We are seeing more projects beginning to move through the pipeline as bidding activity improves.”

But Lines said Graham’s markets also are suffering from a lack of confidence. “Given the uncertain global economy, we are not yet experiencing a strong recovery,” he said in a statement. “Nevertheless, we expect that building demand, when released, will generate a rapid uptick in orders once confidence is restored.”

Graham’s profits dropped to $2.6 million, or 26 cents per share, compared with $5.5 million, or 55 cents per share, a year ago, but that still was better than the 18 cents that analysts were expecting.

The company’s sales fell to $25.9 million from $33.6 million, mainly because international revenues were about a third lower than they were last year.

While sales to the company’s chemical and petrochemical industry customers more than doubled to $8 million, revenues from its power generation market dropped by 35 percent to $6.7 million. Sales for oil refining projects fell by more than half to $5.8 million because of the conclusion of the Middle Eastern refining project last year.

Graham’s order bookings, which can vary widely from quarter to quarter, were strong during the summer, jumping by 30 percent to $25.6 million. The company’s backlog of orders, which is an indicator of future sales, was $92 million at the end of September, virtually unchanged from June but up 23 percent from September 2011.

“We are expecting orders to continue to expand,” Lines said.

Graham said it expects to finish the fiscal year, which ends in March, with about $110 million in sales, which would be about 6 percent more than the $103.2 million in revenues it booked last year.