Iraq has signed a deal with its former Gulf War foe Iran to import Iranian natural gas to feed its power plants near Baghdad in a step aimed at easing the country's electricity shortages, an Iraqi government spokesman said Monday.

Under the four-year deal signed in
Baghdad Sunday night, Baghdad will buy some 850 million cubic feet a day of Iranian natural gas at international prices to feed two power plants in a northeastern suburb of Baghdad to generate 2,500 megawatts, said Mussab al-Mudaris, a spokesman for the Iraqi ministry of electricity.

The gas will be fed through a pipeline that is expected to be completed in two months from now. The pipeline will be crossing
Iraq from Iran through Diayla province east of the Iraqi capital Baghdad , Mr. al-Mudaris said.

He said that some 90% of work on the pipeline has been completed.

The deal was signed in
Baghdad by Iraqi electricity minister Kareem al-Jumaili and Iranian oil minister Rostam Qasemi, he added.

For
Iran , the deal would mark another important market as it struggles under international economic sanctions imposed on the Islamic state for pursuing a nuclear program.

Iraq , which starts an ambitious program to develop its gas fields, doesn't produce enough gas to feed its power stations. The country produces only half of its power need which is estimated at 15,000 megawatts. Iraq also imports around 1,000 megawatts from Iran .

Power outages have prompted anti-government demonstrations over the last few weeks in Shiite-dominated governorates in southern
Iraq where summer heat could reach over 50 Celsius.

Iraq and Iran fought an eight-year war in the 1980s during the rule of the then president Saddam Hussein. Following Saddam's regime fall in 2003 in an operation led by U.S. forces, Baghdad and Tehran have developed close ties under the Shiite-led government of Prime Minister Nouri al-Maliki despite concerns by his opponents, Washington and its Arab allies, including Saudi Arabia , over Iran 's expanding influence in the region.

Tehran has been accused of financing and training Iraqi Shiite militiamen who had launched attacks against Iraqis and U.S. forces before they withdrew from Iraq in 2011. Iran denies these charges.