BRUSSELS – Greece and its creditors in the 19-nation eurozone reached an agreement Friday on extending the country’s rescue loans, a move that should ease concerns it was heading for the euro exit.

Athens will get an extension of four months, not six, as it had requested, said Jeroen Dijsselbloem, the eurozone’s top official. In return, Greece has committed to make a series of unspecified reforms to be enacted over the coming months.

Friday’s agreement was clinched just a week before Greece’s 240 billion euro bailout program expires, leaving barely enough time for some member country parliaments to endorse the deal.

“We have established common ground again,” Dijsselbloem said after the meeting in Brussels.

After two weeks of tense negotiations, the final deal showed compromise by both sides.

Even German Finance Minister Wolfgang Schaeuble, who in recent weeks had taken a tough line, said “this is an important step forward. ”

Greece made the concession to not take any measures that might affect its budget targets. Previously, it had sought to loosen its budget somewhat. It also committed to provide a list of reforms based on its current bailout program for assessment on Monday. However, pensions would not be cut as previously planned.

The list will be reviewed immediately by representatives from the European Central Bank, International Monetary Fund and European Commission and they will report their findings to the eurozone bloc in a conference call.

If the institutions don’t think the proposals are good enough, Greece will have to go back to the drawing board and it would be facing financial trouble again. Its bailout ends at midnight on Feb. 28.

“If our list of reforms is not backed by institutions, agreement is dead and buried but it won’t be shot down by the institutions,” said Greek Finance Minister Yanis Varoufakis.

If the list of reforms is sanctioned, then it will be further detailed and agreed upon by the end of April.

Ultimately, the loan extension will buy time for a deal on how to make Greece’s overall bailout loans more sustainable.

Dijsselbloem said Friday’s agreement was a “first step in this process of rebuilding trust” between Greece and its euro partners and allows for a strategy to get the country “back on track.”

“Trust leaves quicker than it comes,” he said.

Varoufakis claimed the deal was a win for his country because his government will be able to decide what reforms to propose.

“The weekend will be one of joy and creativity,” he told reporters after the meeting. “We are writing our own reforms.”

Varoufakis said the substance of Friday’s deal was to all intents and purposes the same as the government’s proposal to the eurozone on Thursday.

He also said the deal has put paid to the view that ATMs would run out of cash and that he had no doubts that the shares of Greek banks will rebound.

“Greek depositors will be reassured,” he said.

German Finance Minister Wolfgang Schaeuble, whose country is Greece’s most influential creditor, described the agreement as “an important step forward.”