BRUSSELS -- The small Balkan country of Macedonia took a big step Wednesday toward becoming the 30th member of NATO, the world's biggest military alliance.
"This is a historic occasion," Stoltenberg told NATO country envoys before they put pen to paper. "We have waited for you to join our family for a long time."
He said the signing ceremony marks the start of the ratification process. Montenegro, the last country to join NATO, had to wait about a year for all members to formally endorse its accession protocol.
Greece is set to become the first to do so this week. Macedonia will then start calling itself North Macedonia and will join under that name, possibly late this year or in early 2020.
"I'm confident that this process will proceed smoothly," Stoltenberg said.
Visibly moved by the moment, Dimitrov said the ceremony "is the result of the work of many generations," and he thanked the Greek and Macedonian prime ministers for overcoming the name dispute.
"This was not inevitable, this was not even very likely to happen," he said, lauding it as proof that "the impossible is actually doable and possible."
Quoting the British military officer and writer T.E. Lawrence, better known as Lawrence of Arabia, Dimitrov said: "Nothing is written until we write it. We can change our destiny, we can seize opportunities and I think this is what we have done."
Greece blocked Macedonia's NATO membership for a decade over the name dispute. Athens saw the former Yugoslav republic's name as a threat to its own administrative region of Macedonia.
Macedonia has been a major contributor to NATO operations, notably in Afghanistan. The membership move comes some 18 years after the alliance deployed troops in Macedonia to collect weapons held by ethnic Albanian rebels to help avert a civil war there.
Macedonia's ruling Social Democrats described the signature as a "historic act" and "historic success" for the country and its citizens.
"After years of isolation, regression and uncertainty, Macedonia sits at the same table with the states of the democratic world," the party said in a statement.
It underlined that NATO membership means "guaranteed security and stability, security at our borders but also brings significant economic benefits for citizens, investment growth, more money, increased economic growth."
Before the ceremony, Macedonian Prime Minister Zoran Zaev told national broadcaster "MTV" that the name dispute with Greece was "a burden that was dragging us down" for decades.
Konstantin Testorides reported from Skopje, Macedonia. AP writer Elena Becatoros in Athens contributed.