For all of the political and legal intrigue around Canadian oil company PetroKazakhstan (NYSE:PKZ), management continues to do a good job of controlling what is actually under its control.

Results for the second quarter look quite exceptional given the company's circumstances. Consolidated revenue climbed 25% in the quarter and there was close to a 50-50 split between oil revenue and revenue from refinery products. Oil revenue rose 30% in the quarter, while refinery revenue climbed 20%.

Lower production levels and higher transportation costs led to lower margins in the quarter. Although pre-tax margins only slipped by about three points, the impact on the bottom line was such that earnings grew 14% for the period. Through the first half of the year, growth in operating cash flow has tracked that 14% growth rate and free cash flow (FCF) also grew at a double-digit rate.

Production restrictions brought on by anti-flaring laws certainly hurt the company's crude-oil efforts. It managed to pump an average of 106,000 barrels per day (bpd) -- down about 30% from the year-ago level. Management continues to attempt to engage the Kazakh government on this issue and hopes the company will achieve full gas utilization by mid-2006 -- an achievement that would allow them to resume prior production levels.

Despite some ongoing issues within the country -- an anti-monopoly case was recently decided against the company and could cost $55 million -- PetroKazakhstan did have some successes. A pipeline to China was reopened and the company saw about one-quarter of its oil flow into China. Elsewhere, the company saw shrinking differentials in crude varieties and had some exploration successes in new fields.

Amidst all the noise (including potential acquisition offers), PetroKazakhstan continues to book solid performance. Buybacks are cutting the number of shares outstanding and strong cash flow is paying for a nice dividend for a growing E&P company.

As I wrote in an unrelated piece yesterday, stock selection is about relative value -- and relative risk and comfort levels. If you can tolerate a company with some outsized political risks in your portfolio, the valuation here is appealing. But if you're the type who loses sleep at night wondering if a company is going to post $1.00 or $1.01 in earnings, this probably isn't the right sort of stock for you.

More on PetroKazakhstan:

Fool contributor Stephen Simpson has no financial interest in any stocks mentioned (that means he's neither long nor short the shares).