One day after Turkey signed a deal the U.S. helped salvage to end a century of enmity with Armenia, Turkey's leader set a tough condition for normalizing ties on Sunday: Armenia must withdraw from the disputed enclave of Nagorno-Karabakh.

The statement appeared to be an effort by Turkey to appease its close ally Azerbaijan, which said the new agreement will aggravate the Nagorno-Karabakh conflict. Nagorno-Karabakh is an Armenian-occupied enclave in Azerbaijan.

On Sunday, Turkish Prime Minister Recep Tayyip Erdogan hailed the agreement to establish diplomatic ties with Armenia and reopen their border. He called such steps with a former bitter foe an "important step" that would lead to cooperation and dialogue.

However, Erdogan said the Nagorno-Karabakh dispute must be resolved to enable Turkey to take steps to normalize ties and for the deal to be approved by parliament. To take effect, the agreements must be ratified by the Turkish and Armenian parliaments, but the accord faces stiff opposition in both countries.

"We want all conflicts to be resolved and we want all borders to be opened at the same time," Erdogan said. "(But) as long as Armenia does not withdraw from occupied territories in Azerbaijan, Turkey cannot take up a positive position."

"If problems between Azerbaijan and Armenia are resolved the public would more easily accept Turkish-Armenian relations. Approval in the Turkish National Assembly would be so much easier," he said.

The agreement signed Saturday at a ceremony in Zurich, Switzerland, would establish diplomatic relations between Turkey and Armenia and open the joint border, which was sealed after the 1993 Armenian invasion of Nagorno-Karabakh. The enclave is inhabited primarily by ethnic Armenians.

The contentious issue of whether the killing of up to 1.5 million Armenians during the final days of the Ottoman Empire amounts to genocide is only hinted at in the agreement, as is the dispute over Nagorno-Karabakh.

Asked in an interview with French media if Turkey is ready to recognize the World War I killings as a genocide, Turkish President Abdullah Gul said: "We are very open on the subject, but if there is such an allegation — which we don't accept, by the way — who is going to decide?"

He said Turkey has said a committee of historians should decide whether the killings were genocide. The Armenian-Turkish agreement calls for a panel to discuss "the historical dimension" of the killings, including "an impartial scientific examination of the historical records and archives to define existing problems and formulate recommendations."

However, Gul said, "I think we have to move past this. There is a new period starting. ... It's a period of peace, stability, confidence, security and cooperation."

Saturday's ceremony in Zurich went ahead after a last-minute hitch over Turkish and Armenian objections to language in statements to be read after the signing was overcome — by having neither side make a statement.

In last-minute diplomacy, U.S. Secretary of State Hillary Rodham Clinton intervened to save the accord, which had been brokered by Switzerland, after a dispute over the statements the countries would make sparked a delay.

The Azeri Foreign Ministry said Sunday that the agreement "clouds the spirit of brotherly relations" between Azerbaijan and Turkey. It said Turkey should not have re-established diplomatic ties with Armenia before the conflict over Nagorno-Karabakh was settled.

Turkey's opposition party criticized deal on Sunday, saying it does not serve Turkey's interests.

Onur Oymen, deputy leader of the Republican Peoples' Party, said since the deal does not mention an Armenian pullout from Nagorno-Karabakh, Turkey would be forced to open the joint border without assuring a withdrawal from the enclave in return. "These protocols will serve Armenia's interests," Oymen said. "Turkey is faced with a difficult process ahead."

The enclave in Azerbaijani territory is occupied by Armenian troops. Turks have close cultural and linguistic ties with Azerbaijan, which is pressing Turkey for help in recovering its land. Turkey wants Armenia to withdraw some troops from the enclave area to show good will and speed the opening of the border.