With the S&P 500  recently hitting an all-time high and currently trading at nearly 20 times trailing earnings, there is a serious shortage of attractively valued stocks out there. But one energy exploration and production company caught my attention as a potential value pick -- Apache Energy (APA 0.53%). Let's take a closer look at three reasons why the stock may be an attractive buy.

Strong domestic growth outlook
For much of the past decade, Houston-based Apache sought growth primarily through international expansion. But since 2009, it has been rebalancing its portfolio to increasingly focus on its North American onshore operations, where it sees much higher opportunities for growth. Indeed, the company's North American operations are expected to account for 56% of company-wide production this year, up from just 32% in 2009.

The company's most prized domestic assets are in Texas' Permian Basin, where it commands a whopping 1.6 million net acres, and in Oklahoma's Anadarko Basin, where it boasts 1 million net acres. Both regions delivered double-digit year-over-year production growth during the quarter, prompting the company to raise its guidance for North American production growth this year from 25% to 35%.

Over the past few years, Apache has accelerated activity in both plays tremendously. It expects to spend more than $2.4 billion in the Permian and more than $1.4 billion in the central region this year, up from just $0.4 billion and $0.45 billion, respectively, in 2010. With both plays generating attractive rates of return in excess of 30%, and with more than 65,000 drilling locations remaining across both, Apache has a huge runway for continued double-digit growth.

Cash flow generation from international assets
While its North American onshore operations will be the main drivers of growth, the company's international assets -- primarily in Egypt, the U.K. North Sea, Australia, and Argentina -- should continue to generate strong cash flows to fund its North American drilling program. Apache's operations in Egypt, where it recently sold a third of its stake to China's Sinopec (SHI), deserve special mention.

Since drilling its first oil well in Egypt in 1994, Apache has amassed a staggering 9.3 million acres in the vast Western Desert and has become the biggest U.S. investor in the North African nation. The company is operating 26 rigs in Egypt and continues to make major new discoveries across its large position in the Western Desert.

CEO Steve Farris has pointed out time and again just how great a cash generator Egypt has been for the company. Last year, Apache's net production from Egyptian operations averaged 100,000 barrels of oil and 354 million cubic feet, or MMcf, of natural gas per day and generated $2.7 billion in cash flow, while requiring capital investment of just $1.1 billion.

Attractive valuation
Though Apache shares recently hit a 52-week high, the company may still be one of the most undervalued midmajors out there. Shares currently trade at just four times trailing cash flow and 11.7 times forward earnings, considerably cheaper than most of its peers. Apache also sports an EV/EBITDA ratio of approximately 4, significantly lower than the majority of its competitors. By comparison, Anadarko Petroleum (APC), EOG Resources (EOG -0.48%), and Devon Energy (DVN -0.46%) have respective EV/EBITDA ratios of 6.3, 7.5, and 5.7.

The steep discount probably reflects investor concern about the company's exposure to growing social and political risks in Egypt, which I have argued are likely overblown, and its relatively high level of debt as a result of acquiring more than $16 billion  worth of assets since 2010, including the purchase of BP's (BP -1.17%) assets in Egypt and Canada, Devon Energy's Gulf of Mexico properties, ExxonMobil's (XOM -0.09%) North Sea oil fields, and the acquisitions of Mariner Energy and Cordillera Energy.

An opportunity for investors
By rebalancing its portfolio over the past few years, Apache is left with a much more streamlined asset pool that offers strong growth prospects in Texas and Oklahoma, complemented by highly cash-generative international assets. In my view, the markets may be overly skeptical of the company's exposure to Egypt and its relatively high debt load due to an acquisition spree in recent years, providing an intriguing opportunity for value-minded investors.