BAKU (Reuters) -- Turkish Prime Minister Tayyip Erdogan has promised Muslim ally Azerbaijan that Ankara will not open its border with Armenia until Armenia ends its prominent role in the dispute over the Nagorno-Karabakh enclave.

Erdogan was in Baku to ease Azerbaijan's concerns over reconciliation moves by Turkey and Armenia to end decades of hostility. These have alarmed Azerbaijan, which first wants to resolve Nagorno-Karabakh, a territory over which it fought a war with ethnic-Armenian separatists in the 1990s.

Turkey has expressed hopes that its moves to improve ties with Armenia, which supports the ethnic-Armenian administration in Nagorno-Karabakh, will not harm planned energy projects with Azerbaijan.

These include the planned European Union-backed Nabucco gas pipeline which seeks to cut European dependency on Russian natural gas.

"There is a cause-and-effect relation here. Occupation of Karabakh is the cause here and closing of the border is the effect. It is impossible for us to open the border unless that occupation ends," Erdogan told a joint news conference with Azerbaijan's President Ilham Aliyev.

It was Erdogan's first visit to the Azerbaijani capital since Ankara and Yerevan announced last month a "road map" to normalize ties, which would include reopening a border closed in 1993.

Ankara and Yerevan have been engaged for months in high-level talks since Turkish President Abdullah Gul became the first Turkish official to visit Armenia last year.

Erdogan urged the so-called Minsk Group -- set up in 1992 and co-chaired by Russia, the United States, and France -- to speed up efforts to find a solution to Nagorno-Karabakh.

Erdogan, who travelled to Baku accompanied by Energy Minister Taner Yildiz and other ministers, said officials from the two countries would discuss changing the price at which Ankara purchases Azerbaijani natural gas.

Turkey buys about 6 billion cubic meters of Caspian natural gas annually after a pipeline from the Azerbaijani Shah-Deniz field opened in 2007. Some of that gas, which Turkey buys at a discount, is shipped on to Greece. Turkey is seeking an additional 8 billion cubic meters of gas from Azerbaijan.

Partners in the 7.9 billion-euro Nabucco project, aimed at cutting Europe's dependency on Russian gas, want Azerbaijani gas to fill the pipeline when it opens in 2013.

Nabucco will eventually carry about 30 billion cubic meters of gas from the Caspian and Middle East to meet about 5 percent of European demand.