Media playback is unsupported on your device Media caption The two leaders unveiled a plaque at the site, as the BBC's Mike Wooldridge reports

President Asif Ali Zardari of Pakistan and Iran's Mahmoud Ahmadinejad have inaugurated a controversial gas pipeline linking the two neighbours.

The US has warned that the project could incur sanctions connected with Iran's nuclear programme.

The long-delayed pipeline is seen in Pakistan as a way of alleviating the country's chronic energy shortages.

The work on the Iranian side is almost complete. Construction in Pakistan will begin on Monday.

Analysis The pipeline decision is bound to provide an additional irritant in relations between Washington and Islamabad. The US has consistently warned that the pipeline - if built - could potentially lead to US sanctions against Pakistan as part of Washington's efforts to contain Iran's nuclear programme. Washington insiders, though, suggest that this would be more likely to become an issue once the gas flow was ready to be switched on. That could still be some years away. Indeed, one of Washington's biggest criticisms of the pipeline is that it does nothing to address Pakistan's immediate energy needs. The US sees a good measure of domestic Pakistan politics in all of this - elections are looming - and it may be for a future government in Islamabad to face the moment of truth: either to risk US sanctions by switching the gas on or to risk domestic criticism by being seen to cave in to US pressure.

Live television footage showed the two presidents shaking hands with dignitaries as the ceremony got under way at the border.

"There are people who are against the progress of Iran, Pakistan and other countries. They have found an excuse - called the nuclear issue - to exert pressure on Iran and to prevent its progress," President Ahmadinejad said.

"I want to tell them the gas pipeline has nothing to do with nuclear energy; you can't make an atomic bomb with natural gas."

President Zardari said the project was very important for Pakistan and was not "directed against any other country".

A total of 780km (485 miles) of pipeline is due to be built in the country over the next two years.

Dubbed the "peace pipeline", talks on the project began in 1994. The pipeline was initially intended to carry gas on to India, but Delhi withdrew from negotiations in 2009, just a year after it signed a nuclear deal with the US.

The US says the project would enable Iran to sell more of its gas, undermining efforts to step up pressure over Tehran's nuclear activities.

"If this deal is finalised for a proposed Iran-Pakistan pipeline, it would raise serious concerns under our Iran Sanctions Act. We've made that absolutely clear to our Pakistani counterparts," State Department spokesperson Victoria Nuland told reporters last week.

Washington - a major donor to Pakistan - has also argued that there are other ways to ease Pakistan's energy crisis. One option favoured by the US is a plan to import gas from Turkmenistan through Afghanistan, which has been under discussion for years.

But power shortages have become a major and pressing issue in Pakistan, and the government there insists it will not bow to pressure.

A nationwide power cut last month was blamed on a technical fault in a plant in south-western Balochistan province, but it highlighted the energy challenges the country faces.

Blackouts are common in Pakistan because of chronic power shortages, and many areas are without electricity for several hours a day,

Last year, Foreign Minister Hina Rabbani Khar said the pipeline was "in Pakistan's national interest" and would be completed "irrespective of any extraneous considerations".

BBC world affairs correspondent Mike Wooldridge notes that some analysts say President Zardari feels it is an opportune time to be assertive with the US, with elections on the horizon in Pakistan.

But our correspondent says Pakistan acknowledges that the pipeline route through the troubled province of Balochistan presents significant security challenges.

Separatist rebels fighting for autonomy and an increased share of mineral resources have frequently targeted pipelines in the gas-rich province.