MADRID — The Spanish police on Friday carried out the first arrests in Western Europe of citizens accused of traveling to Ukraine to fight on the side of the Russian-backed rebels there.

Eight Spaniards were arrested in dawn raids across different regions of Spain, including in Madrid and Barcelona, the Interior Ministry said in a statement.

Those arrested, the ministry said, recently returned to Spain after going to Ukraine last year to join pro-Russian troops around Luhansk and Donetsk. The ministry said that they had been identified partly by information that the eight had posted online, including photographs of themselves wearing paramilitary uniforms and training with explosives and assault rifles.

The fighters are likely to be charged with participating in activities considered to be terrorism by Ukraine, the ministry said, including taking part in assassinations and carrying illegal weapons. The ministry also said that fighting in Ukraine could in itself amount to a violation of “the neutrality of Spain.”