MOSCOW — A court in Ukraine has ruled that officials in the country violated the law by revealing, during the 2016 presidential election in the United States, details of suspected illegal payments to Paul Manafort.

In 2016, while Mr. Manafort was chairman of the Trump campaign, anti-corruption prosecutors in Ukraine disclosed that a pro-Russian political party had earmarked payments for Mr. Manafort from an illegal slush fund. Mr. Manafort resigned from the campaign a week later.

The court’s ruling that what the prosecutors did was illegal comes as the Ukrainian government, which is deeply reliant on the United States for financial and military aid, has sought to distance itself from matters related to the special counsel’s investigation of Russia’s interference in the 2016 presidential race.

Some of the investigation by the special counsel, Robert S. Mueller III, has dealt with Mr. Manafort’s decade of work in Ukraine advising the country’s Russia-aligned former president, Viktor F. Yanukovych, his party and the oligarchs behind it.