ATHENS — 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.