Turkey and Armenia signed an accord Saturday to establish diplomatic relations after a century of enmity, as US Secretary of State Hillary Rodham Clinton helped the two sides clear a last-minute snag.
"It was pulled back from the brink," said a senior US official.
The Turkish and Armenian foreign ministers signed the agreement in the Swiss city of Zurich after a dispute over the final statements they would make. In the end, the signing took place about three hours later and there were no spoken statements.
Officials say Clinton and mediators from Switzerland intervened to help broker a solution.
The accord is expected to win ratification from both nations' parliaments and could lead to a reopening of their border, which has been closed for 16 years.
But nationalists on both sides are still seeking to derail implementation of the deal.
American officials said Clinton; the top US diplomat for Europe, Philip Gordon; and Swiss Foreign Minister Micheline Calmy-Rey were engaged in furious high-stakes shuttle diplomacy with the Turkish and Armenian delegations to resolve the differences.
Diplomats said the Armenians were concerned about wording in the Turkish statement that was to be made after the signing ceremony at University of Zurich and had expressed those concerns "at the last minute" before the scheduled signing ceremony.
Clinton had arrived at the ceremony venue after meeting separately with the Turks and Armenians at a hotel, but abruptly departed without leaving her car when the problem arose.
She returned to the hotel where she spoke by phone from the sedan in the parking lot, three times with the Armenians and four times with the Turks. At one point in the intervention, a Swiss police car, lights and siren blazing, brought a Turkish diplomat to the hotel from the university with a new draft of his country's statement.
After nearly two hours, Clinton and Armenian Foreign Minister Edward Nalbandian met in person at the hotel and drove back to the university where negotiations continued. It was not clear if there would be a resolution.
In the end, the Turks and Armenians signed an accord establishing diplomatic ties in hope of reopening their border and ending a century of acrimony over their bloody past. Their parliaments are expected to ratify it, but nationalists on both sides are seeking to derail implementation of the agreement.
Protests have been particularly vociferous among the Armenian diaspora.
"The success of Turkey in pressuring Armenia into accepting these humiliating, one-sided protocols proves, sadly, that genocide pays," said Ken Hachikian, chairman of the Armenian National Committee of America.
Major countries, however, expressed their support for the accord, with the foreign ministers of the United States, Russia, France and the European Union in the room to watch the much-delayed signing.
"No problem, they signed," quipped French Foreign Minister Bernard Kouchner.
In Turkey, Prime Minister Recep Tayyip Erdogan said his country was showing "goodwill" to restore ties with Armenia. But he said Turkey was keen on seeing Armenian troops withdrawn from Nagorno-Karabakh, an Armenian-occupied enclave in Azerbaijan that has been a center of regional tensions.
"We are trying to boost our relations with Armenia in a way that will cause no hard feelings for Azerbaijan," Erdogan told reporters.
Armenian President Serge Sarkisian said his country was taking "responsible decisions" in normalizing relations with Turkey, despite what he called the unhealable wounds of genocide.
The agreement calls for a panel to discuss "the historical dimension" of the killing of an estimated 1.5 million Armenians during World War I. The discussion is to include "an impartial scientific examination of the historical records and archives to define existing problems and formulate recommendations."
That clause is viewed as a concession to Turkey, which denies genocide, contending the toll is inflated and that those killed were victims of civil war.
"There is no alternative to the establishment of the relations with Turkey without any precondition," said Sarkisian. "It is the dictate of the time."
Clinton, Kouchner and Russian Foreign Minister Sergey Lavrov were among the leaders who were on hand to watch the signing as it took place.
Better ties between Turkey, a regional heavyweight, and poor, landlocked Armenia are a priority for President Barack Obama. They could help reduce tensions in the troubled Caucasus region and facilitate its growing role as a corridor for energy supplies bound for the West.
Javier Solana, the EU's foreign policy chief, thanked Turkey, which is a candidate for European Union membership.
"This is an important cooperation, no doubt, of Turkey to solve one issue that pertains to a region which is in our neighborhood," Solana told AP Television News after arriving in Zurich.
Switzerland, which mediated six weeks of talks between Turkey and Armenia to reach the accord, hosted the signing.
Necati Cetinkaya, a deputy chairman of Turkey's governing Justice and Development Party, defended the deal, saying "sincere steps that are being taken will benefit Turkey." He said Turkey is aiming to form friendly ties with all its neighbors and could benefit from trade with Armenia.
But Yilmaz Ates of the main opposition Republican People's Party said Turkey should avoid any concessions.
"If Armenia wants to repair relations ... then it should end occupation of Nagorno-Karabakh. That's it," Ates said Saturday.
About 10,000 protesters rallied Friday in Armenia's capital to oppose the signing, and a tour of Armenian communities by Sarkisian sparked protests in Lebanon and France, with demonstrators in Paris shouting "Traitor!"
On the Nagorno-Karabakh issue, Turks have close cultural and linguistic ties with Azerbaijan, which is pressing Turkey for help in recovering its land. Turkey shut its border with Armenia to protest the Armenian invasion of Nagorno-Karabakh in 1993.
Turkey wants Armenia to withdraw some troops from the enclave area to show goodwill and speed the opening of their joint border, but Armenia has yet to agree, said Omer Taspinar, Turkey project director at the Brookings Institution in Washington.
"We may end up in a kind of awkward situation where there are diplomatic relations, but the border is still closed," Taspinar said.