Violence broke out after police refused to allow the farmers, who had sailed to Piraeus from the island of Crete, from driving their tractors through the capital, Athens, to protest low prices and demand financial aid from the government.
Ferry services were disrupted, as some of the more than 1,000 farmers hurled rocks and planks of wood at police and set fire to trash bins in the port.
The clashes maintained pressure on Greece's conservative government, which has faced a two-week standoff with protesting farmers demanding higher subsidies, and endured massive riots in December after police shot dead a teenage boy.
Prime Minister Costas Karamanlis' conservative government has trailed the Socialists in opinion polls for the last five months.
The head of Greece's main opposition Socialist Party, struggling to speak to farmers through the tear gas, said the protests were a result of problems being faced by farmers "not just in Crete, but across all of Greece."
"The government doesn't want to talk or listen to your demands," George Papandreou said, grimacing in pain and trying to shield his eyes from the gas.
Protest organizer Giorgos Dispirakis said the farmers wanted to meet with government ministers for talks, but were backing off their demand to drive their tractors through Athens.
Last month, Greek farmers blocked highways nationwide, hampering imports and the transportation of goods, until the government promised a $645 million support package.
But some farmers say that is not enough. Some who stayed in Crete protested Tuesday by driving tractors through towns and occupying government buildings. In northern Greece, farmers continued a two-week blockade of a border crossing with Bulgaria.
In Athens, the deputy interior minister defended the police's action in Piraeus, saying there was minimal use of tear gas and no excessive force.
"The police did not attack. They were threatened by tractors, which were used with murderous intent against them," Christos Markoyiannakis told Parliament.