(Repeats with no changes)
* After night of talking, negotiations nearly broke down
* Tsipras, Merkel dug heels in over privatisation fund
* Differences, emotions show bailout plan remains fragile
By Alastair Macdonald
BRUSSELS, July 13 (Reuters) - As a feeble sun came up out of a grey Brussels dawn on Monday, for a time it looked like it might be about to set on Greek hopes of clinging on to the euro.
Alexis Tsipras was "close to walking out", a source close to the euro zone summit said. The prime minister told other leaders that if he accepted one final bailout condition, fellow Greeks would brand him a sell-out and he "may as well not go home".
After 14 hours of talks with German Chancellor Angela Merkel and other euro zone leaders, Tsipras was refusing to yield on the last outstanding item on a list of loan terms which some critics say indicated that Berlin wants to humiliate his leftist government and, perhaps, drive Greece from the euro.
"If I agree to such an escrow, I may as well not go back," a second source who was present at the summit quoted Tsipras as telling fellow leaders after Merkel demanded that he place 50 billion euros of state assets in Luxembourg, out of reach of his government. Cash generated would then pay off Athens' creditors.
"I can buy a ticket to fly to any other country," Tsipras said. "Because back home they'll think that I sold out Greece."
With markets in Europe about to open, and uncertainty over a continued cash lifeline for the Greek financial system from the European Central Bank, stalemate could have tipped Greece into a bankruptcy that would have shut it out of the common currency.
In the end, after summit chairman Donald Tusk said he would not let Tsipras and Merkel out of his office until they agreed, compromise emerged on the privatisation fund. It would be in Greece, managed by the government - under supervision - and a quarter of its revenue would go to investment not debt payments.
"There was great relief because it really was extremely close to the worst-case scenario at 6 o'clock," the source said, adding that several of the other government leaders waiting elsewhere in the building had begun to talk about heading home.
Yet the near-collapse of the "last chance" talks underlines the fragility of a plan to refloat the Greek state. Some senior euro zone officials echo analysts who see it doomed to failure.
"This is not a done deal by any means," said one senior official who has negotiated with Tsipras's leftist government since it was elected in January on a promise to end austerity.
To even open formal negotiations, Tsipras must overcome party rebels to ram legislation through parliament by Wednesday. He must also secure lawmakers' approval for the overall three-year bailout package. That may be a tall order.
"They did nothing for six months and alienated anyone who tried to help them," the euro zone official said. "If they can start doing some of these things now, let's see.
"But they have zero margin."
A person present at the summit overnight said, however, that Tsipras seemed still to be grappling with technicalities of Greece's parlous financial position, growing worse by the day as bank closures and capital controls ravage its economy.
"We had serious doubts whether Tsipras understands," he said. IMF chief Christine Lagarde and ECB head Mario Draghi both intervened twice at the summit table to explain to him how their institutions were financing his budget and Greece's banks.
Also constraining the 40-year-old Marxist is his reliance on a coalition, many of whom have never been, or expected to be, in government. Tusk emerged from breakout talks with Tsipras, Merkel and French President Francois Hollande suggesting a deal was ready, only for the Greek premier to return after consulting aides and allies by telephone to say: "I cannot commit."
After accepting conditions that amount to a resignation of sovereignty over swathes of policy, Tsipras dug his heels in over the German-designed privatisation plan. But Merkel set a "red line" of her own on the same issue after forcing Tsipras to cross a host of boundaries the Greek had sworn not to breach.
With fatigue magnifying the mistrust and bickering that has marked the summit, and fearing the worst for the entire EU from an unpredictable rift in its supposedly irreversible currency union, former Polish prime minister Tusk decided to act.
They could not go until they had reached a deal, he said. One official joked that he might have threatened to lock them in his office -- only he had no key.
Merkel held her ground, anxious to keep the euro zone intact but conscious that many Germans, maybe including her own finance minister Wolfgang Schaeuble, would rather see Greece forced out.
So too did Tsipras, pointing to estimates that companies on a list to be privatised may be worth only five billion euros.
With the clock ticking, officials said it was Lagarde, with her IMF technical expertise, who broke the deadlock with a design for the fund that offered something for both sides.
Many international analysts questioned, however, whether the mistrust and economic damage can be repaired to see the three-year cash-for-reform programme, Greece's third, implemented.
"This will merely delay the inevitable," wrote Jonathan Loynes of Capital Economics. "A Greek exit from the euro zone might just have been kicked down the road a bit."
A senior EU official said that even getting the loan deal off the ground would be tough: "This is going to be a long hard summer. Some people are saying it's over. This is only a start." (Additional reporting by Andrius Sytas; Editing by Giles Elgood)