* Law is litmus test for Ukraine: president
* Unclear if law complies with IMF requirements
* Parliament votes to sack finance minister
* IMF expresses concern after sacking (Adds IMF reaction)
By Pavel Polityuk and Natalia Zinets
KIEV, June 7 (Reuters) - 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.
But an hour later, lawmakers voted to sack Finance Minister Oleksandr Danylyuk -- praised by investors for pushing reforms -- after he publicly fell out with the prime minister, potentially casting a cloud over Kiev's aid negotiations.
In its first comments after the vote, the International Monetary Fund said it would assess whether the law guaranteed an independent and trustworthy court, and also expressed concern after Danylyuk's departure.
The new 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, passed muster with the IMF, which supports Ukraine with a $17.5 billion cash-for-reforms package.
"What we'll be looking to see is that it ensures the establishment of an independent and trustworthy anti-corruption court that meets the expectation of the Ukrainian people," IMF spokesman Gerry Rice said at a briefing.
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 even 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.
Danylyuk's ouster comes at a delicate point in the aid negotiations.
Even if the IMF ends up being 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.
Parliament sacked the finance minister after he made a short speech defending his record and rejecting the characterisation of him as a stooge for Ukraine's creditors.
"I am not a defender of interests of international organizations, I defend the interests of Ukraine," he said.
Other MPs and Groysman attacked Danylyuk's track record in office and his behaviour. After being voted out, the minister shook hands or hugged lawmakers as he left.
'RISKS STILL HIGH'
Speaking to reporters later, Danylyuk hoped his successor would not be a political figure who would use the ministry as a piggy bank for the elections.
"In reality, the situation in the country is deteriorating and it needs to be recognized," he said. "The risks are still very high."
The IMF also expressed worries.
"We don't comment on personalities or internal personnel issues. But our staff had expressed concerns about possible changes in the institutional role of the finance ministry," Rice said. "The finance ministry should retain, in our view, its central and crucial role in fiscal policy."
Francis Malige, the senior representative for the European Bank for Reconstruction and Development in Kiev, called Danylyuk a great supporter of reforms.
"It is equally important to find a quick replacement for Minister Danylyuk and that whoever succeeds him continues to play a key role in supporting reform, maintaining macroeconomic stability and working with the central bank in steering the country in times that are still volatile," he told Reuters.
Groysman said Danylyuk had shown poor judgment by airing his grievances in a letter to the G7 group of nations, which the prime minister said may have harmed Ukraine's negotiations with the European Union for more aid.
Danylyuk will be replaced by his first deputy until a permanent replacement is found.
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. (Additional reporting by Matthias Williams and Olena Vasina in Kiev and David Lawder in Washington; Writing by Matthias Williams Editing by Gareth Jones and Hugh Lawson, Larry King)
Our Standards: The Thomson Reuters Trust Principles.