Updated

A top U.S. official said Saturday that Ukraine is failing its test on democracy in the run up to parliamentary elections, citing the jailing of ex-Prime Minister Yulia Tymoshenko and shrinking media freedoms.

The jailing of Tymoshenko, the country's top opposition leader and heroine of the 2004 Orange Revolution, has strained Ukraine's relations with the West, which has condemned her conviction as politically motivated. The European Union has frozen a key cooperation deal with Kiev.

Thomas Melia, the U.S. assistant deputy secretary of state for democracy, human rights and labor, said the Ukrainian election set for October has been compromised by the jailing of Tymoshenko and another top opposition leader. Melia said Ukraine "failed the test today."

"I think if the international community, the international observers, were to give a grade today on this election environment and whether it is going to mark a step toward Europe and the West, I think it failed that test today," Melia told an international conference in the Ukrainian Black Sea city of Yalta. "I think with the political prosecution, politically directed prosecutions, against certain opposition candidates, that has serious consequences on the quality of the election here."

The conference had been dedicated to Ukraine's integration into the EU, but many speakers used it to put the government on the defensive by criticizing its policies.

Tymoshenko was sentenced to seven years in prison last October on charges of abusing her powers while negotiating a natural gas import contract with Russia in 2009. She denies the charges, and accuses President Viktor Yanukovych, her longtime foe, of jailing her to bar her from the vote.

"The case — from the very beginning — was politically motivated," said Tymoshenko's top aide, Hrihoriy Nemyria, said at the conference.

Yanukovych, whose fraud-tainted victory in 2004 was annulled under the pressure of massive street protests dubbed the Orange Revolution, has resisted strong Western pressure to release her, saying he has no influence over Ukraine's courts.

Deputy Prosecutor General Renat Kuzmin maintained a tough stance on the Tymoshenko case, suggesting the Ukrainian leaders will not bow to Western pressure.

"The issue of freeing Tymoshenko is exclusively in the framework of the law enforcement and judicial system of Ukraine and no statements, political declarations and blackmailing will lead to a positive decision," Kuzmin told the conference.

But Swedish Foreign Minister Carl Bildt, who was just denied permission to visit Tymoshenko in jail, suggested that keeping her behind bars will effectively prevent Ukraine from joining the Western club, which it strives to do.

"If you try to go everywhere you will likely end up nowhere," Bildt said. "You cannot pursue a policy of reforming, truly modernizing a country, without being very dedicated to a strategy and a mission."