Dozens of youths broke away from the peaceful rally and threw rocks and flares at riot police, who responded with pepper spray and stun grenades, in clashes that were relatively minor.
More than 7,000 police had cordoned off parks and other sections of city to keep demonstrators away from the German leader.
As a helicopter buzzed overhead, thousands of protesters, chanting "History is written by the disobedient" gathered in front of Greek parliament. One group of demonstrators burned a Swastika and threw it onto a police barrier, while a group of special forces reservists appeared in uniform and chanted "Merkel out of Greece" in time to their march.
"I have no doubt that (Merkel) has good intentions, and wants to help, but that won't solve Europe's problem," retired teacher Irini Kourdaki said. "Europe is polarized and ... we need a major change in policy."
Merkel's visit followed a subtle shift in political rhetoric in Germany toward the Greeks, with the chancellor repeating her desire to keep Greece in the eurozone and urging political allies to refrain from public criticism of the Athens government. It appeared that a goal of the trip was to affirm her support for Samaras as Germany's best bet to see through painful structural reforms which the Germans believe are necessary if Greece is to regain economic stability.
That was a marked difference with the tone of statements made last summer, when some Merkel allies were openly dismissive of the Greeks for alleged economic mismanagement. Some politicians even suggested that Greece's departure from the common currency would not produce the economic shock that many fear.
The visit was also likely aimed at preventing the opposition Social Democrats from criticizing her for allegedly failing to display strong personal leadership in the euro crisis in the run-up to national elections expected in about a year.
Merkel told reporters in Athens that the troika report was "taking longer than was originally thought."
"But it's better to deal with problems in detail that to try and address them quickly," she said.
A senior Greek government official said rescue creditors had given the country a list of around 90 structural reforms to be approved immediately so that the vital next loan installment could be paid sometime next month.
The official asked not to be named, since talks between Merkel and Samaras were ongoing.
AP writers in Berlin and AP television and photography staff and in Athens contributed.