KIEV - Ukraine's parliament passed a law on Thursday to create a special court to try corruption cases, a key step for the government to secure more Western aid needed to tame a rising sovereign debt burden.

The law is meant to ring-fence court decisions from political pressure or bribery in Ukraine, where entrenched corruption remains a deterrent to foreign investors. Trusted international experts will help screen the chosen judges.

President Petro Poroshenko called the vote a litmus test for the country's ability to tackle corruption and, after the law passed, said it was a victory for Ukraine, while Prime Minister Volodymyr Groysman said it would spur economic growth.

"We gave a clear signal to the whole country and international partners that the fight against corruption is intensifying," Groysman said.

But it was not clear whether the law, which has undergone around 2,000 amendments, will satisfy the International Monetary Fund, which supports Ukraine's economy with a $17.5 billion cash-for-reforms package.

Ukrainian lawmakers said Kiev had brokered a late compromise formula with its foreign backers on how big a veto international experts would have on unsuitable candidates.

Not everyone was convinced, and before the vote a lawmaker even suggested contacting the IMF and the Venice Commission, a watchdog whose advice had been sought, to get live confirmation that the law complied with the IMF.

Even if the IMF is happy with the law, the government has yet to fulfill other conditions such as raising gas prices and it may struggle to stick to the IMF's budget deficit target of 2.5 percent as elections loom next year.

The likely sacking of Finance Minister Oleksandr Danylyuk -- praised by investors for pushing reforms -- after he fell out with Groysman could also cloud aid negotiations. Parliament may vote on his dismissal on Thursday.

Time is ticking for Ukraine as it counts down to presidential and parliamentary elections next year while having to pay back debt worth $15 billion by the end of 2020.

The economy is still recovering from a steep recession following Russia's annexation of Crimea in 2014 and separatist fighting in the industrial Donbass region. The IMF says corruption knocks two percentage points off Ukraine's growth every year.

Dragging its feet on reforms, Ukraine has not received aid from the IMF since April 2017. Not securing more aid tranches would blow a $4 billion hole in the budget, according to Danylyuk.

Ukraine has tussled over the corruption court law with its international creditors. Lawmakers previously said the IMF's insistence on giving international experts a veto on candidates violated Ukraine's sovereignty and constitution.

Yulia Tymoshenko, a former prime minister who polls suggest could defeat Poroshenko next March, said the court would be under Poroshenko's thumb.

Allies including the United States, which has supported Ukraine with aid and sanctions on Russia since the Crimea crisis, had pressed parliament to pass the law.

Separately, Groysman has asked parliament to sack Danylyuk after they tussled over the appointment of a deputy minister.

Danylyuk hit back with a statement alleging that he had been asked to support political corruption or else quit. If dismissed, Danylyuk will be replaced by his first deputy until a permanent replacement is found.

(Additional reporting by Olena Vasina; Writing by Matthias Williams Editing by Gareth Jones) ((matthias.williams@thomsonreuters.com;))