"What a great day!" a beaming President Petro Poroshenko said in Brussels. "Maybe the most important day for my country after independence" from the Soviet Union in 1991.
Russia opposes closer ties between Ukraine and the EU. Moscow is loath to see its historic influence wane in its strategic neighbor, which it considers the birthplace of Russian statehood and of Russian Orthodox Christianity.
"There will undoubtedly be serious consequences for Ukraine and Moldova's signing," Russian Deputy Foreign Minister Grigory Karasin said.
European Union leaders decided not to immediately impose new sanctions on Russia for destabilizing eastern Ukraine. But in a statement, they warned that new sanctions have been prepared so they could be levied "without delay" and listed several demands for Vladimir Putin's government and the pro-Russian rebels in eastern Ukraine.
Poroshenko's pro-Moscow predecessor, Viktor Yanukovych, had backed out of signing the agreement in November, igniting the bloody protests that toppled his government in February. Tensions between Ukrainians in the west who want closer ties to Europe and those who favor traditional ties with Russia sparked an insurgency in the east and Russia's annexation of the mainly Russian-speaking Crimean Peninsula in March.
On Friday, celebrations were muted at Kiev's Independence Square, where the protests began. Blue balloons - the color of the EU flag - were released and rose over the crowd of several hundred as a rock band pounded out the European Union's anthem, the "Ode to Joy" from Beethoven's Ninth Symphony.
The crowd was far smaller than the thousands who jammed the square at the height of the protests. Intermittent rain, people getting out of town ahead of a long holiday weekend, and uncertainty over the simmering conflict in the east worked to restrain the mood.
Protest veteran Oleg Mityukhin, 48, came wrapped in the Ukrainian flag. "I think there will be less corruption, there will be better quality goods, and it will be a push forward for the development of Ukraine," he said.
His wife, Oksana, 46, expressed optimism about the future and the impact of the treaty. "It depends on us, on each one of us," she said.
In a speech, Poroshenko reminded EU leaders of the scores of Ukrainians who died opposing Yanukovych's government and in the ongoing battle against the insurgency.
"(Ukraine) paid the highest possible price to make her European dreams come true," he said, asking the leaders to take a further step and formally pledge that one day Ukraine can join the 28-nation bloc.
"(That) would cost the European Union nothing," he said, "but would mean the world to my country."
Agreements signed Friday let businesses in the former Soviet republics of Ukraine, Moldova and Georgia trade freely in any of the EU's nations without tariffs or restrictions as long as their goods and practices meet EU standards. Likewise, goods and services from the EU will be sold more easily and cheaply in the three countries.
Putin did not immediately comment on the trade pact but has signaled that he wants to de-escalate the conflict. Poroshenko began a unilateral cease-fire against the separatists a week ago, which was to expire Friday.
"The most important thing is to guarantee a long-term cease-fire as a precondition for meaningful talks between the Kiev authorities and representatives of the southeast (of Ukraine)," Putin said Friday.
The weeklong cease-fire, which both sides accuse the other of violating, was set to expire at 10 p.m. but Poroshenko told a news conference he would decide later Friday whether to extend it.
The EU leaders gave the Russian government and the rebels until Monday to take steps to improve the situation in eastern Ukraine, including agreeing on a way to verify the cease-fire, returning three border checkpoints to Ukraine, releasing all captives and launching "substantial negotiations" on Poroshenko's peace plan.
Insurgent leader Alexander Borodai said the rebels are ready to extend a cease-fire and will soon release the European observers they have been holding for weeks.
He spoke after talks Friday in the eastern city of Donetsk involving a former Ukraine president, the Russian ambassador and an envoy from the Organization for Security and Cooperation in Europe.
Borodai, however, demanded Ukrainian troops withdraw from eastern Ukraine and rejected the EU demand to withdraw from the Ukrainian checkpoints on the border with Russia they have seized.
Amanda Paul, a policy analyst at the Brussels-based think tank European Policy Center, said Russia has levers to inflict serious economic pain on Ukraine, Moldova and Georgia through trade restrictions, cuts in energy supplies or the deportation of migrant workers from those countries.
Georgia has already lost chunks of its territory and Black Sea coast to rebels backed by Russia after a brief war in 2008.
European Commission experts estimate the deal will boost Ukraine's national income by 1.2 billion euros ($1.6 billion) a year. Ukraine won a 15-year transition period during which it can use tariffs to support its domestic auto industry from competition. Moldova will gradually eliminate protections for its dairy, pork, poultry and wine producers over 10 years, while the EU placed limits on imports of chicken from both countries.
The trade deal also demands that Ukraine changes the way it does business. Adopting EU rules on government contracts, competition policy and copyright for ideas and inventions should improve Ukraine's economy by reducing widespread corruption and making it more investor-friendly.
Interior Minister Arsen Avakov told Ukraine's Fifth Channel that at least 20 servicemen had been killed since the rebels agreed to the cease-fire Monday. He said the government would respond "harshly and adequately" to all rebels who did not put down their arms by Friday evening.
There was no corresponding casualty figure from the rebels.
An overnight battle for a National Guard base in the eastern city of Donetsk left the rebels in control early Friday. All servicemen were set free but the commander was taken captive.
The U.N. said Friday that 110,000 Ukrainians had fled to Russia this year and another 54,000 fled their homes but stayed in Ukraine. Long lines of cars stuffed with belongings backed up at the border headed into Russia this week.
AP correspondents Laura Mills in Moscow, David McHugh in Kiev and Balint Szlanko in Donestsk, Ukraine, contributed.