Diplomats at the Barcelona meeting faced a deadline of midday on Monday to come up with common conclusions between nations as different as Syria and Britain.
Benita Ferrero-Waldner, EU External Relations Commissioner, said on Sunday: "As always, there will be negotiations until the end, but I am optimistic we will get an agreement."
Diplomats said problems remained in the phrasing of the declaration of a common vision on the fight against terror.
A declaration would crown the summit, held to celebrate 10 years of the Euro-Mediterranean partnership, but the meeting started badly when only two of the 10 leaders from outside the EU showed up.
Tony Blair, the British Prime Minister, who is hosting the summit, said: "Obviously, there are various reasons why some of the leaders have not been able to come, but I am sure we shall have a good conference none the less."
The absence of such leaders as Israeli Prime Minister Ariel Sharon gave centre stage to Palestinian President Mahmoud Abbas, who met Blair and Angela Merkel, the new German Chancellor. He lauded EU involvement in the past week's opening of the Rafah border crossing between the Gaza Strip and Egypt and said that move will soon be followed by more.
Ferrero-Waldner said that, in principle, the EU was ready to support such moves.
Merkel said Europe can win the support of North African and Middle Eastern nations in the fight against terror and illegal immigration only "if we offer these countries an economic perspective".
Special forces officers check the
sewers before the summit
The summit, she said, must give a signal "that we need one another".
Leaders from Egypt, Algeria, Israel, Jordan, Syria, Lebanon, Tunisia and Morocco stayed away from the meeting, with reasons ranging from a medical problem for Algerian President Abdelaziz Bouteflika to political unrest at home for Egyptian President Hosni Mubarak. Apart from Abbas, the only non-EU leader expected to turn up was Turkish Prime Minister Recep Tayyip Erdogan.
The EU spends $3.5 billion a year in grants and soft loans on its southern neighbours.
In the centre of Barcelona, more than 2000 demonstrators banging drums and blowing whistles called the partnership a failure, unable to alleviate poverty in northern Africa or bring peace to the Middle East.
Joan Herrera, a member of the Spanish parliament, said: "Here many declarations of intentions are made. But things simply don't change."