Caterpillar Inc. (NYSE: CAT), a manufacturer of heavy construction and mining equipment, on Friday said quarterly earnings fell more than expected due to lower sales of diesel truck engines, weakness in North American construction markets, and higher production costs.

The results, which the company called disappointing, sent Caterpillar shares down more than 5 percent in pre-market trading and weighed on the whole market.

Caterpillar's stock had enjoyed a long, sustained rally in recent years as the company benefited from almost unprecedented demand in all of its markets, including residential construction, and the oil, gas and mining industries.

But some analysts said that left the stock priced for perfection just as two of Caterpillar's top North American markets, the on-highway diesel engine market, and the construction industry, simultaneously began to sour.

Caterpillar said its second-quarter net profit fell 21 percent to $823 million, or $1.24 a share, from $1.05 billion, or $1.52 a share, a year earlier.

Sales and revenue rose 7 percent to $11.36 billion. Stripping out $743 million in revenue generated by its financial products unit, Caterpillar reported machinery and engine sales of $10.61 billion.

Analysts, on average, expected the Peoria, Illinois-based company to report a profit of $1.49 a share on machinery and engine sales of $10.34 billion, according to Reuters Estimates.

Eli Lustgarten, an analyst at Longbow Securities, said Caterpillar's woes included a massive negative price squeeze, as price increases were unable to keep up with the rise in costs.

Caterpillar said production inefficiencies at its truck-engine manufacturing operations, which it said were experiencing lower-than-anticipated volume because of new clean-air rules, played a big role in the jump in costs.

But Lustgarten said the squeeze was an annual occurrence and that while it had come earlier this year than in the past, he expected it would quickly correct.