Italy said it was suspending the EU's border-free Schengen arrangements with Spain in response to a mass influx of migrants into the Spanish territory of Ceuta from neighbouring Morocco.
Italy does not share a land border with Spain but the measure - which looks certain to anger Madrid - will impact people travelling by plane or boat between the two countries, meaning they will need to show a passport to gain access.
The Schengen Area allows passport-free travel across 29 European countries, although member states can temporarily reintroduce border controls on security or public-order grounds.
Italy's interior ministry said in a statement it had also agreed with Paris to strengthen controls along the Franco-Italian land border to try to prevent any undocumented migrants from crossing.
Critics of Italian Prime Minister Giorgia Meloni's right-wing government dismissed the move as a symbolic gesture aimed at a domestic political audience, with no evidence that the migrants in Ceuta had any intention of heading to Italy.
Watch: Moment migrants rush into Spain's Ceuta from Morocco
The decision to halt the Schengen pact came after Spain said it had reversed the rush of migrants into its territory in North Africa, with most of the more than 50,000 people who had crossed the border heading back voluntarily.
Ms Meloni's coalition, which came to power in 2022 promising to reduce illegal immigration, has faced strong pressure from a new far-right party led by former army general Roberto Vannacci, whose anti-migrant rhetoric has resonated with some voters.
With migration once again dominating headlines, the Italian government has sought to demonstrate a tough stance on border security. Centre-left opponents accused it of bowing to a populist agenda.
"The problem is that this is a purely demagogic proposal, as usual designed for domestic consumption and to compete with Vannacci, without solving anything at all," said Piero De Luca, a senior politician with the centre-left Democratic Party.

Ceuta and Melilla, Spanish autonomous cities in northern Morocco, have the European Union's only land borders with Africa. Both periodically experience surges in attempted crossings by migrants seeking to reach Europe, but the scale of yesterday's rush appeared unprecedented.
Spain's Interior Ministry said around 50,000 people had crossed the border since yesterday morning, and estimated that around 37,500 had already turned and gone back.
Juan Jesus Vivas, head of Ceuta's local government, said as many as 60,000 people had pushed across over the past couple of days.
The Spanish government's representative in the territory of Ceuta said 57 bodies had been recovered on the Spanish side of the border and that there could be additional casualties on the Moroccan side. It said some drowned and some were crushed while trying to climb the breakwater that holds the border fence.
Moroccan forces beat back crowds with batons and tear gas at the gates to Ceuta, trying to prevent more from storming across into the tiny Spanish territory that juts on a spit of sandy land into the Mediterranean from Morocco.
The rush on the border caused division in Europe, where leaders of fellow EU states called for Spain to ensure that the incident was contained.
Right-wing parties around the continent blamed the incident on Spain's comparatively lax migration policies, including an amnesty granted to hundreds of thousands of unauthorised migrants this year.
France said it was increasing checks on its border with Spain.
US President Donald Trump, a long-time critic of Spain's Socialist government, weighed in on the Ceuta situation.
"That's going to be us in three years if the wrong side gets in," Fox News cited him as saying, referring to the next presidential election.
At the territory's border, Reuters saw Moroccan police in riot gear using tear gas to disperse some of the people amassed near the fences. Water cannon trucks were deployed and the charred remains of a bus and seven cars could be seen from clashes with the crowds.
On the other side, Spanish military vehicles lined up along sections of the border as dozens of migrants watched from a hilltop in Morocco, unable to cross.
Several hundred people could be seen returning to Morocco through border posts and holes in the fence, with some saying they could not find food or shelter in Ceuta.
Spanish Prime Minister Pedro Sanchez travelled to Ceuta today, where he was greeted with insults from protesters.
He called the mass crossing "a violation of Spain's territorial sovereignty" and said authorities were speeding up the repatriation of those who had entered illegally, with full cooperation from Morocco.
In a post on X, Spain's Guardia Civil police association AUGC said there had been too few police in place to monitor the fence during the surge yesterday, making them unable to stop the rush.
Territorial Policy Minister Angel Victor Torres said that among factors contributing to the surge may have been a ruling by Spain's Supreme Court earlier this month that migrants intercepted at sea while attempting to reach Ceuta or Melilla cannot be summarily rejected at the border. Experts say that still does not prevent their expulsion.
On the Moroccan side of the border, thousands of migrants streamed into the town of Fnideq overnight despite a reinforced deployment of security that foiled most attempts to cross. Some began leaving again later today.
Although the crossing appeared blocked, groups moved along the coast seeking routes around the fence.
Migration is one of the most divisive issues in Europe, where far-right parties have been on the rise and much of the political mainstream has backed tougher policies.
Spain's government, an outlier to the continental trend of tightening rules, says it remains firm over illegal crossings but that immigrants benefit Spain and help strengthen its fast-growing economy.
It offered a mass amnesty that saw hundreds of thousands of people seek legal residency over the past few months.