Video footage showed hundreds of migrants swimming over from the Moroccan side using inflatable inner tubes and other flotation devices, and others breaking through a gate in the fence and running into the city.
The scene was reminiscent of a crossing in 2021, when about 10,000 people from Morocco and sub-Saharan Africa, many of them minors, entered the enclave of 85,000 people in days.
A Guardia Civil spokesperson said earlier the migrants were "massively entering from the sea" through the Tarajal breakwater and police were overwhelmed but could not provide any estimates for the numbers.
State television TVE reported that 2000 to 3000 people had crossed.
Reuters was not immediately able to confirm that report.
The Spanish interior ministry said three platoons of 20 soldiers each, a diving unit and a military vessel would be deployed by Friday.
Special police intervention units were also being reinforced to a total of 200 personnel, it said.
The Ceuta regional government had earlier called for Spain to deploy the army to guarantee safety and close the border with Morocco.
Many local shops were shuttered.
Enrique Serrano, who runs a women's clothing store in central Ceuta, told Reuters business owners were organising themselves to protect their property and families in case of possible disturbances as they believed police resources would be insufficient.
"I'm not opening this afternoon because the situation is extremely tense ... The first thing I have to do is protect my business and my family," he said, adding that when the fence was breached after midnight, hundreds of migrants rushed through in a matter of minutes.
Ceuta, together with Melilla - another Spanish autonomous city located in North Africa - represents the Europe's only land border with Africa.
Both cities periodically experience surges in attempted crossings by migrants seeking to reach Europe.
Images showed some of the migrants shouting "Viva España!" - Long live Spain - as they entered the territory.
Spain's Socialist government stands out in Europe for its pro-migrant stance, and has recently launched a program to provide legal status for 500,000 undocumented migrants, creating an influx of applications double that number.
Conservative parties criticised the drive, arguing it would attract more migrants to Spain, and were quick to blame Prime Minister Pedro Sanchez for allowing the situation in Ceuta to reach crisis proportions.
Opposition People's Party leader Alberto Nuñez Feijoo said in a post on X: "The situation in Ceuta is desperate. The government cannot look the other way ... because we are facing a national security crisis."
Sanchez said he had told the leader of Ceuta, Juan Jesus Vivas, that his government was "fully focused" on delivering an immediate response and preparing measures to restore normality as soon as possible.
Earlier on Thursday, Vivas had urged the Spanish government to declare an emergency over the mass arrivals.
The Spanish defence ministry said there were no immediate plans to deploy the army.
Earlier this month, Spain's Supreme Court ruled that migrants intercepted at sea while attempting to reach Ceuta or Melilla cannot be summarily returned under the enclaves' special border-rejection regime.
"It has been a slow trickle since the Supreme Court's ruling but today it has been an explosion," a Guardia Civil spokesperson told Reuters.
The Spanish interior ministry said it was working closely with Morocco to address the surge in irregular arrivals, having prevented thousands of migrants from illegally entering Ceuta in recent days.
It vowed to immediately deport those entering illegally, blaming people-smuggling networks for exploiting the Supreme Court's ruling to encourage undocumented migration.
Migrant rights activist Zakaria Zarroqui said people were still flocking to the Moroccan city of Fnideq in an attempt to cross into Ceuta and the situation was still out of control.
with AP