By SUZANNE DALEY, New York Times

On the eve of his election in January, Prime Minister Alexis Tsipras of Greece talked with pride about how his leftist Syriza party rejected “the mentality of establishment parties” and provided space for the diverse views of its members.

But last week, Mr. Tsipras ousted members of his cabinet who had defied him by voting against the package of austerity measures that Greece’s European creditors had demanded as the price of new bailout negotiations. To Syriza members of Parliament who voted against that package and are threatening to oppose a second bill scheduled for a vote on Wednesday, Mr. Tsipras has made clear that he might call a new election and replace them with a slate of lawmakers loyal to him.If Mr. Tsipras was an idealistic young radical six months ago, dedicated to the overthrow of the Greek establishment and austerity policies, he is emerging from the showdown with the creditors as something else entirely: a popular, canny and pragmatic politician with a stake in the success of the very measures he came to power vowing to eradicate.

Mr. Tsipras, 40, may still be refusing to wear a tie, but otherwise he has moved a long way toward the mainstream.

In the process, he has defied what appeared to be European efforts to oust him, even as he has bowed to much of the agenda the creditors imposed on him. And now the question is whether he can create a new center of gravity in Greek politics, one focused not on ending austerity, but on carrying it out in a progressive way and restoring some sense of fairness and hope to a country that has been short on both.

If he pulls it off, it will be a remarkable political transformation for himself and for Greece.

Some Syriza supporters are shocked by the new Mr. Tsipras, who is conversant in the most minor details of the bailout he is negotiating and who argues on occasion that the deal might include some reforms that Greece badly needs.

On television recently, Mr. Tsipras said that some pension changes would have been necessary with or without the demands of the country’s creditors.

“I do not think that it is progressive political policy to send someone into retirement at 45 or 50,” he said.

Aris Chatzistefanou, a left-wing journalist and documentarian who watched the hourlong televised interview with Mr. Tsipras, concluded that the prime minister, his face puffy from lack of sleep, had forgotten his youth. “That we can say for sure,” Mr. Chatzistefanou said. “The guy with the Che Guevara T-shirt, we lost him.”

But others saw Mr. Tsipras becoming exactly what the country needs, a politician who will be able to build an even broader constituency now, pulling in more centrist voters, who are desperate to stay in the eurozone but sick of the country’s old political parties, which failed to prevent the burden of past austerity policies from falling on the poor and the salaried.

“Tsipras is showing an incredible advantage as a politician,” said George Pleios, a media expert at the National and Kapodistrian University of Athens. “He is showing that he is able to speak the language of reform and the language of social justice. This is a formula that can turn him into a very important leader in Greece.”

“The winner in all of this will be Tsipras,” he said.

For now, Mr. Tsipras is fighting hard to prevent a wholesale fracturing of his party — a group that includes everything from those flirting with Trotskyism to some former representatives of the center-left — telling Syriza members that he needs them to stand with him. Political analysts say that the party has always tolerated dissent and that the moment is hard on Mr. Tsipras, who considers some of his more ardent critics to be good friends.

But the risk of a Syriza breakup remains real, just as Mr. Tsipras prepares to embark on negotiations with Greece’s creditors on the details of the bailout — his nation’s third in five years — and on his demands for some relief from the Greek government’s debt load. Dissenters on the party’s left, including Yanis Varoufakis, his former financial minister, are showing no hint of backing down in their opposition to the creditor-imposed measures, which the nation rejected in a referendum just days before Mr. Tsipras accepted them.

A critical indicator of his problems within his party could come with the vote on Wednesday on the second legislative package, which would speed regulatory changes in banking and overhaul the country’s civil justice system.

As frustration on the left has grown, Mr. Tsipras may face more resistance to this package than he did with the first one last week. He could struggle to win backing from at least 120 of the 162 parliamentary representatives from his minority coalition government — a level of support generally considered necessary for such a government to survive. In the vote on the first package on July 15, encompassing tax increases and pension cuts, 123 members voted yes, including all 13 from the Independent Greeks party, Syriza’s coalition partner.

Mr. Tsipras decided to delay votes on two other contentious issues — new taxes for farmers and further changes to the pension system — to avoid the battle within Syriza from getting out of hand, an official close to Mr. Tsipras said. But those measures, too, will eventually have to be passed, if Mr. Tsipras is to lock down a bailout package worth as much as 86 billion euros, or about $95 billion.

In another country, the size of the rebellion Mr. Tsipras is facing in his own party would spell the end of the legislation and of his government.

But neither is true in Greece. The opposition guaranteed the passage of his proposals last week and is set to do the same on Wednesday. And though opposition leaders are likely to excoriate Mr. Tsipras before the vote, they say there is no move afoot to call a confidence vote in an effort to bring down the government.

The opposition does not particularly want new elections, for fear that it might end up losing more ground. Mr. Tsipras, it seems, is the last person standing in Greece’s political landscape, without a rival in sight.

Polls suggest that even today, after coming home from negotiations in Brussels with a deal that violates just about every campaign promise he made, Mr. Tsipras remains a hero to many Greeks, for having put up such a fight and now for taking on the responsibility of doing whatever it takes to keep the country from crashing out of the eurozone.

He has struck a populist tone since the bailout proposal was negotiated this month, suggesting that he would protect the interests of regular people against the wealthy and powerful. He has also been able to point to the prospect for debt relief and a package of short-term economic aid from Europe to help create jobs, which could take some of the sting out of the new austerity measures.

Many Greeks talk as if they know Mr. Tsipras, worrying about what he eats and the toll all this has taken on his health.He has many choices for staying in power. He could continue with a minority government. He could create a unity government with elements of the opposition, though analysts say that is probably his least favorite option.

He wants nothing to do with partnerships that would involve parties he sees as in the pockets of the country’s oligarchs, the analysts say.

Mr. Tsipras is most likely to simply hold elections after the negotiations with the country’s creditors are done, campaigning on the promise of mitigating the harshness of the measures and of fighting hard to make the rich pay their fair share instead of evading taxes.

Mr. Tsipras, experts say, will be speaking to a population that is deeply fed up with the politics of the last 40 years and hopes he offers a change. The two parties that traded power during that time, the center-right New Democracy and the center-left Pasok, are in disarray.

Mr. Tsipras benefits from having never had anything to do with those parties. “The vast majority of Greeks want a break from the parties of the past,” said Nick Malkoutzis, a political analyst with MacroPolis, a website that specializes in news analysis.

Mr. Malkoutzis said new elections were likely to be held fairly quickly, perhaps in September, and would favor Mr. Tsipras because the effects of the creditors’ demands would not have been felt yet and the promise of substantial debt relief would still be alive.

For the time being, many in Mr. Tsipras’s party who are voting against the creditors’ demands want him to continue as prime minister without calling elections.

They say that even if they fight the austerity measures accepted by Mr. Tsipras, he still has their support.

But officials close to Mr. Tsipras have called that strategy unworkable.

“Constantly voting down measures is incompatible with a common course,” Nikos Pappas, Mr. Tsipras’s chief of staff, said this week. “I think this is obvious to everyone.”