Iraq's cabinet has approved a $365 million contract with Iran's oil ministry to build a pipeline to move gas from Iran to Iraq for power generation, it said.

The pipeline will pass through Iraq's Mansuriyah gas field near the Iranian border in volatile Diyala province and will feed two power plants; one in Sadr City in northern Baghdad and another on the northern outskirts of the capital.

The pipeline was to be completed in 18 months, the Electricity Ministry said when it signed a memorandum of understanding for the project in May.

The ministers also approved the first payment for the project, 25 percent of the total value of the contract, the cabinet said in a statement issued on Wednesday.

Iraq has struggled for years with power shortages. More than eight years after the US-led invasion that toppled Saddam Hussein, Iraqis receive only a few hours of electricity a day from the national grid.

The shortage was a key complaint during recent nationwide protests. The Opec member is trying to step up its own gas production and signed an initial contract with South Korean group Kogas, Kuwait Energy Company, and Turkey's state-owned TPAO last year to develop the Mansuriyah natural gas field.

Iran and Iraq fought an eight-year war in the 1980s in which hundreds of thousands were killed. Ties have improved since Saddam was ousted by the US invasion and a Shi'ite-led government came to power in Iraq. -Reuters