In just seven months, former — and perhaps future — Greek Prime Minister Alexis Tsipras appears to have undergone a remarkable evolution. In September’s snap election, he will stand for the opposite of what he defended in January, when he came to power. Yet the qualities that made that possible may make him a good leader for Greece going forward.

Tsipras’s trajectory took him from the Thessaloniki Program, on which his party, Syriza, campaigned for election last fall and winter, through the tumultuous negotiations with Greece’s creditors and finally the bailout program, an act of economic capitulation that split Syriza and forced Tsipras to resign. The two documents are ideological opposites, and few politicians could have gone the vast distance between them as quickly as Tsipras did.

Here is Tsipras’s path in tweets:

Jan. 22: “On Jan 25, #democracy will return to Greece, to all of Europe #syriza #ekloges2015 #ChangeEurope.”

Feb. 11: “I want to assure the Greek ppl that our policies will be implemented in full & I’m optimistic that we’ll find a compromise w/EU partners.”

May 15: “I want to assure the Greek people that the government will not renege on the issue of salaries and pensions. @TheEconomist #Greece.”

June 24: “The repeated rejection of equivalent measures by certain institutions never occurred before-neither in Ireland nor Portugal. #Greece (1/2). This odd stance seems to indicate that either there is no interest in an agreement or that special interests are being backed. #Greece (2/2).”

June 28: “Some people think that matters in #Greece are a game. The dignity of our people is no game. #vouli #referendum.”

June 28: “Many are asking: what happens after the #referendum? With a clear “NO”, we will have a much stronger negotiating position. #Greece #vouli.”

July 1: “Its unacceptable that in Europe of solidarity bank closure would be forced, as a response to Gov’t letting Greek ppl decide #Greferendum.”

July 5: “The Greek people made a historic and brave choice. Their response will alter the existing dialogue in Europe. #Greece #Greferendum.”

July 13: “My statement following the conclusion of the Eurozone Summit #Greece #EuroSummit http://goo.gl/wc3hHO” [“I believe that a large majority of the Greek people will support the effort to return to growth; they acknowledge that we fought for a just cause, we fought until the end, we have been negotiating through the night, and no matter what the burdens will be, they will be allocated – we guarantee this – with social justice.”]

Aug. 20: “The popular mandate I received on January 25th has run its course. Now, the sovereign people of #Greece must weigh in.”

This dizzying trip from hope to resignation can be described as a path of self-serving betrayal (the radical wing of Syriza’s version), a young, inexperienced leader’s tough road to maturity (I can imagine European Commission President Jean-Claude Juncker thinking along these lines), or a journey along the rails of inevitability (Tsipras himself would like to present it that way).

The third version is probably closest to the truth: Tsipras and his band of radicals tried everything they could to get Greece off the austerity path, but found out that Greece was unable to sustain itself. In July, the European Central Bank stopped increasing support for the Greek banking system, the Tsipras government was forced to close the banks and ration cash. According to former Finance Minister Yanis Varoufakis, Greece didn’t even have the resources to reintroduce the drachma to replace the euro, and attempts to find a viable Plan B were feeble, bootstrap efforts.

Tsipras peered into the abyss, and he didn’t like what he saw. His former Energy Minister Panagiotis Lafazanis was undeterred, so now he’s the leader of a splinter group called Popular Unity, the third biggest faction in the Greek parliament devoted to “smashing the euro zone dictatorship,” as Lafazanis puts it, and taking Greece out of the euro. 

Tsipras has been in similar situations before. He was once a member of the Greek Communist Party’s youth organization, but chose to remain in Synaspismos, a radical leftist coalition, after the Communists split from it in 1991, just as the Lafazanis faction has just now split from Syriza. He was less interested in fighting from the fringes than in building a new leftist party to supersede the centrist PASOK as the main party of the left. He watched, and took part in, the complicated internal dynamics of Synaspismos with its many warring factions.

Tsipras rose to the Synaspismos leadership committee in 2004, soon after it formed an electoral alliance with other leftist parties, including, again, the Communists. The alliance was called Syriza. He became Synaspismos leader in 2008 as internal debates raged on whether Syriza should be disbanded. He then managed to keep it together despite an electoral defeat, and finally won big in 2015. The tumultuous story of Synaspismos, described in a 2009 paper by University of Athens’ Costas Eleftheriou, gives a good idea of the kinds of skills Tsipras would have acquired in this environment.

He may not have learned the kind of negotiating expertise needed to sway European finance ministers, but he knows the Greek left and is a master of political maneuvering. He is also personally popular and polls suggest that Syriza, even after the split, has the support of about a third of Greek voters. Tsipras will probably be back in September, at the head of a new coalition government. And whereas his election in January was arguably a disaster for Greece, this time it would probably be a blessing.

That’s because the bailout agreement has largely taken economic decision-making out of the government’s hands. In these circumstances, Tsipras is the ideal figure to have at the top, where his gift for managing factional politics and keeping explosive tempers in check will be essential. He will keep the public pacified with his obviously sincere sympathy for Greeks’ plight. He will make sure — at least for a time — that the bailout isn’t derailed and the European money keeps flowing. This is not a particularly farsighted scenario, but then, Tsipras’s seven months in power have proved him to be a tactician, not a strategist.