KIEV (Reuters) - Ukrainian security said on Tuesday it had barred two Spanish journalists from the country over their coverage of a conflict with eastern separatists - a move media groups decried as an attack on free speech.

The State Security Service (SBU) said the reporters had produced stories alleging Ukrainian troops had shelled civilian areas, an account it said was false.

Antonio Pampliega and Angel Sastre wrote on Twitter they had been barred from entering Ukraine at Kiev’s main airport last week.

“After 20 hours detained in Kiev a military man arrived and put us on an airplane without explanations,” wrote Sastre. “They have treated us like criminals, the only thing missing is putting us in chains,” said Pampliega.

SBU spokeswoman Olena Gitlyanska said they had “been forbidden from entering due to activity that is contrary to the interests of Ukraine.”

“Look at what they’ve published,” she said, when asked for details.

A massive leak of journalists’ personal data in 2016 added to concerns that Ukraine is reneging on promises to improve transparency in the wake of a 2013-14 pro-European uprising.

The Spanish Press Association (APM) called on the Spanish government to ask the Ukrainian authorities for an explanation over the two reporters.

“The work of journalists in countries at war is essential so that citizens can receive independent and true information, and governments should not obstruct this under any pretext,” it said in a statement.

Ukraine is fighting a pro-Russian separatist insurgency in eastern regions that has killed more 10,000 people.

In 2015, it backtracked on a decision to bar a number of British, Spanish and German correspondents.