Oil production in Iraq surpassed that of its regional rival Iran last month, highlighting the impact of continued investment in Iraq and Western sanctions on Iran.

Iraqi oil production inched over the 3 million barrel a day mark in July, according to numbers released Friday by the International Energy Agency. That's 300,000 barrels per day higher than the country's average output in 2011.

IEA said much of July's increase was due to the opening of a new offshore tanker-loading facility in the Persian Gulf.

Oil production in the country has been slowly but steadily climbing since the end of the war as the Iraqi government and partners such as Exxon Mobil (XOM), BP (BP), Chevron (CVX) and Total (TOT) work to repair existing fields and hunt for new sources.

With oil prices around $90 per barrel, Iraq's production rate translates into roughly $100 billion a year in revenue. The vast majority of this goes to the Iraqi government. Most of the foreign oil companies in Iraq work on a contract basis, or else pay a high royalty rate.

Iraq has lofty plans to one day produce 11 million barrels a day -- nearly equal to Russia's current output and a million barrels a day more than Saudi Arabia's production.

Iran just can't stop pumping oil

But with the security situation still dicey -- there were two pipeline attacks in the last month alone -- and a lack of an oil law stipulating just how the oil wealth will be divided up among the Iraqi people, companies are wary of investing too much in the country, and development remains slow. Realistically, analysts say, in the next ten years Iraq is more likely to increase production to 6 or 7 million barrels a day.

"We don't see Iraqi production increasing at a fast rate anytime before 2014," said Patrick Gibson, an oil supply analyst at the energy consultants Wood Mackenzie.

Iran: In Iran, oil production has taken a serious hit as a result of sanctions imposed by the United States, The United Kingdom and the European Union over Iran's nuclear program. The sanctions prohibit the import of Iranian oil to the West and limit the amount that Asian countries, the principle buyers or Iranian crude, can import without being restricted from Western markets.

As a result, Iran's oil production dropped to 2.9 million barrels day in July from 3.6 million barrels per day in the last quarter of 2011, according to the IEA report.

The question around Iran's production is how fast it can come back when and if the sanctions are lifted.

Gibson said that, because of the complex legal structure around sanctions, it can take a long time for countries to resume imports even once the sanctions are lifted. Plus, there's the possibility that shutting in Iran's oil will damage the oil fields, leaving them less productive.

Both of these may be moot points for the time being however, as Iran show's no signs of curtailing its nuclear program, which it says is for peaceful purposed but many suspect is intended to produce a bomb.