Merkel joined Hungary's President Laszlo Solyom to honour former East German refugees who made the dash across the Austro-Hungarian border on August 19, 1989.
Swedish Foreign Minister Carl Bildt, representing the European Union, and his Austrian counterpart Michael Spindelegger were also there.
The event was being held on the same field at Sopronpuszta where the Pan-European Picnic was organised in 1989 to celebrate the dismantling of the Iron Curtain.
Moves to take down the fence, which had for more than two decades divided the West from the Communist bloc, had begun in Hungary in May 1989, and on August 19, it was to be symbolically opened for three hours.
But minutes before the gates were opened, a crowd of East Germans broke through and made the dash over the border to freedom.
“We were not afraid at all ... if you want freedom so desperately you do not think about fear,” Simone Sobel, who was part of the first group of East Germans to cross over to the democratic west, recalled on Wednesday.
“I was then waiting on the other side for my husband to arrive with a later group,” she said, standing at a sample of barbed wire fence left as a memento on the Austro-Hungarian border, a few hours before the celebrations started.
It was here that the couple made the break with their two daughters, aged two and four, because they could not imagine their lives in communist East Germany anymore, Walter Sobel told AFP.
“It was the same sunny day as today,” the couple, now living near Dortmund, said as they looked around in the hope of seeing some friends from 20 years ago.
More than 600 people made it across to Austria that day, the first massive exodus of East Germans to the west since the construction of the Berlin Wall in 1961.
The peaceful picnic “helped to change the course of European history,” European Commission President Jose Manuel Barroso said in a statement ahead of Wednesday's commemoration.
“It led to a brief opening of the Iron Curtain and contributed to its final fall and the peaceful unification of Germany,” he said. “The Sopron picnic thereby marked the beginning of the end of the division of Europe by the Cold War.”
Merkel, who spent most of her childhood and studied in East Germany, also spoke ahead of the event.
“My trip to Hungary is a thank you, to Hungary and to the people who live there, as well as to the organisers at the time who showed courage and foresight and who helped speed up the process of democratisation in central and eastern Europe,” she said in a video on her website.
The Pan-European Picnic was organised by Hungarian opposition parties under the patronage of Imre Pozsgay, a prominent reformist member of the Communist party Politburo, and Otto von Habsburg, the president of the International Pan-European Union and son of the last Austro-Hungarian emperor.
On August 19, 1989, the East German ambassador to Hungary at the time, Gerd Vehres, was invited to another event, far from the Pan-European Picnic, he said Wednesday.
“It was the day after the 19th that I understood why I was unwanted at the picnic. It would have been awkward if I had been there,” he noted.
After the Hungarian government officially opened the border on September 11, an estimated 50,000 East Germans fled to Austria.
Two months later, on November 9, the Berlin Wall fell.
Hungary was where “the first stone was removed from the Berlin Wall,” the then German chancellor Helmut Kohl said in Berlin on the day East and West Germany were reunified on October 4, 1990.