Updated

Iraq has signed a tentative deal with Iran to import natural gas to ease its electricity woes, an official said Monday, in a step that deepens economic ties with Tehran as U.S. troops prepare to leave at the end of the year.

Iraq's government has been struggling to rebuild its war-damaged electricity grid after power shortages last summer spurred demonstrations that turned deadly when security forces fired into crowds. But blackouts are still common despite billions spent on improving power stations and lines.

Iraq's Electricity Ministry spokesman, Mussab al-Mudaris, said the five-year plan with Iran will let Iraq buy 25 million cubic meters of natural gas each day to feed two power plants in northeastern suburbs of Baghdad — one built by Iran and the other by South Korea's Hyundai conglomerate.

Al-Mudaris said the gas will be fed through a pipeline expected to completed by the end of 2012. The deal still needs the backing of Iraq's Cabinet and parliament, but al-Mudaris expected approval within a month.

For Iran, the pact would mark another important market as it struggles under international economic sanctions from the standoff over its nuclear program. Iran, which has the world's second-largest gas reserves, also has looked to boost exports to central and south Asia.

Iraq's currently produces about 7,000 megawatts of electricity daily — about half of the actual demand. More than half of Iraq's imported electricity — about 1,000 megawatts — comes from Iran. Al-Mudaris said it could rise to about 75 percent next month.

Iraq and Iran have developed close bonds under the Shiite-led government of Prime Minister Nouri al-Maliki despite concerns by Washington and Arab allies, including Saudi Arabia, over Iran's expanding influence in the region.

Iran has been accused of financing and training Iraqi Shiite militiamen who have launched attacks against Iraqi and U.S. forces. Iran denies the claims.

Many of Iraq's majority Shiites, persecuted by Saddam Hussein's Sunni-led regime, sought sanctuary in Iran. They have since returned after the Iraqi dictator's fall in the 2003 U.S.-led invasion, and some now hold key government posts.