Portugal has reached a deal on a three year bailout loan with the European Union and IMF, caretaker Prime Minister Jose Socrates said on Tuesday.

The terms of the agreement will give Portugal more time to meet its budget deficit targets than previously promised by the government, Socrates said in a televised statement.

Socrates did not provide the amount of the bailout but a source close to the negotiations told Reuters it would reach 78 billion euros. The European Commission, the European Central Bank and the International Monetary Fund have been discussing conditions of the rescue with Portugal's caretaker government for three weeks.

(Reporting by Axel Bugge and Andrei Khalip; editing by Shrikesh Laxmidas)