MOSCOW — After months of foot-dragging that exasperated its Western backers, Ukraine on Thursday adopted legislation that opens the way for the establishment of an independent anticorruption court.

The move, long demanded by the International Monetary Fund and Western governments, could help unblock billions of dollars in assistance frozen because of Western dissatisfaction with Ukraine’s failure to deliver on promises to tackle endemic graft and cronyism.

At the same time, however, the Parliament in Kiev, the Ukrainian capital, also voted to dismiss the country’s finance minister, Oleksandr Danylyuk, an outspoken champion of measures to curb corruption in Ukraine’s fiscal and customs service.

The votes by legislators — one signaling a major step forward in Ukraine’s on-again off-again struggle against corruption, the other a serious setback — added to a growing sense of muddle in Kiev. Last week, Ukrainian authorities announced that a dissident Russian journalist had been murdered in the Ukrainian capital, only for the journalist to appear very much alive the next day at a press briefing.