European External Relations Commissioner Benita Ferrero-Waldner told a European Parliament committee before official results were announced that "it is clear that Hamas has really got a very large proportion of the vote".
"What is important is that we state we are happy to work with any government if that government is prepared to work by peaceful means," she said.
The 25-nation European Union is the biggest provider of aid to the Palestinian Authority, amounting to 500 million euros ($614.9 million) last year, of which 280 million came from the common EU budget and the rest from member states.
The Commission is its executive arm and administers its external assistance programmes, but it has limited influence on EU foreign policy.
There was no immediate comment from the EU Council, the forum in which the bloc's 25 member states set foreign policy.
Both the United States and Israel have ruled out dealing with Hamas in government.
Hamas majority means the party
can shape a government
The Islamist movement, which is officially committed to the destruction of Israel, is on the EU's list of banned terrorist groups after a series of bombings and rocket attacks on Israel.
Israel's ambassador to the European Union told Reuters this week the bloc should have nothing to do with Hamas even if it joined the government.
The Palestinian delegate-general to the EU and Belgium, Leila Shahid, told Belgian radio the EU should apply the same conditionality in its relations with the Palestinian Authority as it did to other Mediterranean partners, and it should hold Israel to account by the same standard.
British Foreign Secretary Jack Straw urged the Hamas to renounce violence and recognise Israel following its success in the Palestinian legislative elections.
"Hamas has to understand that with democracy goes renunciation of violence," Straw said on a visit to the Turkish capital.
Jack Straw: Hamas has to
"It is up to Hamas to choose. We will have to wait and see, the international community will want Hamas to make a proper rejection of violence and to acknowledge that Israel exists," Straw said.
France's prime minister expressed concern after Hamas' shock success in Palestinian elections and said a Hamas government must renounce violence and recognise Israel.
"What is certain is that we are faced with a situation that leads me to express my concern," said Dominique de Villepin.
He called for rapid consultations between European governments and said France expects the new Palestinian government to meet certain conditions for cooperation to be possible.
Italian Premier Silvio Berlusconi has said the Hamas's victory was a "very, very, very bad result", news reports said.
Berlusconi described Hamas
victory as a very bad result
Italy's foreign minister said the result risks making the creation of a Palestinian state more difficult.
"If this news was confirmed, everything we had hoped for, that chance for peace between Israel and Palestine, is postponed to who knows when," Berlusconi said, according to the ANSA and Apcom news agencies.