MOSCOW — Bowing to pressure from international donors, the Ukrainian Parliament voted on Tuesday to remove a prosecutor general who had clung to power for months despite visible signs of corruption.
But in a be-careful-what-you-wish-for moment, veteran observers of Ukrainian politics said that the prosecutor, Viktor Shokin, had played an important role in balancing competing political interests, helping maintain stability during a treacherous era in the divided country’s history.
The United States and other Western nations had for months called for the ousting of Mr. Shokin, who was widely criticized for turning a blind eye to corrupt practices and for defending the interests of a venal and entrenched elite. He was one of several political figures in Kiev whom reformers and Western diplomats saw as a worrying indicator of a return to past corrupt practices, two years after a revolution that was supposed to put a stop to self-dealing by those in power.
As the problems festered, Kiev drew increasingly sharp criticism from Western diplomats and leaders. In a visit in December, Vice President Joseph R. Biden Jr. said corruption was eating Ukraine “like a cancer.” Christine Lagarde, the managing director of the International Monetary Fund, which props up Ukraine financially, said last month that progress was so slow in fighting corruption that “it’s hard to see how the I.M.F.-supported program can continue.”
With this pressure mounting, Parliament on Tuesday voted by a comfortable margin to remove Mr. Shokin.
In the final hours before Parliament voted him out, Mr. Shokin had fired his reform-minded deputy prosecutor, David Sakvarelidze, with whom he had been feuding. It was not immediately clear whether that firing would remain in force.
With the prosecutor’s office in turmoil throughout Ukraine on Tuesday, one of Mr. Sakvarelidze’s appointees in the Odessa regional office was arrested by military prosecutors, assumed to be loyal to Mr. Shokin.
Foreign donors had complained about rot in the prosecutor’s office, not least because much of the money suspected of being stolen was theirs.
In one high-profile example, known in Ukraine as the case of the “diamond prosecutors,” troves of diamonds, cash and other valuables were found in the homes of two of Mr. Shokin’s subordinates, suggesting that they had been taking bribes.
But the case became bogged down, with no reasons given. When a department in Mr. Shokin’s office tried to bring it to trial, the prosecutors were fired or resigned. The perpetrators seemed destined to get off with claims that the stones were not worth very much.
For many Ukrainians, the case encapsulated a failure to follow through on the sweeping promises made during the heady days of the revolution to root out corruption and establish a modern, transparent state. Instead, there has seemed to be a return to business-as-usual horse-trading and compromise among the tightly knit Ukrainian oligarchic and business elite.
Since his appointment a year ago, Mr. Shokin had been criticized for not prosecuting officials, businessmen and members of Parliament for their roles in corrupt schemes during the government of former President Viktor F. Yanukovych. He also did not press cases for sniping by the police and opposition activists during the street protests in 2014 that killed more than 100 people and wounded about 1,000.
To a certain extent, analysts say, accommodations of this sort are necessary if the government is to get anything done in Parliament, because supporters of the Yanukovych government remain a political force in Ukraine, coalesced around the Opposition Bloc party. It represents Russian-speaking southeastern areas of Ukraine and the former elite, whose support in Parliament President Petro O. Poroshenko needs to push through reforms and to try to implement a peace accord with the Donbass.
“There are prices the new political establishment has to pay,” Tymofiy Mylovanov, the president of the Kiev School of Economics, said in an interview. “How do they pay? They guarantee some security for their opponents’ business interests.”