Moroccan Prime Minister Abbas el Fassi has criticised Spanish King Juan Carlos's visit to the Spanish-held enclaves on the tip of North Africa.
This is the king's first visit to the enclave in his 32-year reign
He said Spain should know the colonial era is over and the return of Ceuta and Melilla should be directly negotiated.
Thousands waving Spanish flags greeted the king on his arrival in Ceuta.
But 1,000 Moroccans staged a protest on the Moroccan side of the border. Morocco recalled its ambassador to Spain in protest at the king's visit.
Spanish Foreign Minister Miguel Moratinos has said he hopes the visit will not affect Spain's good relations with Morocco for long.
Moroccan authorities have described the visit as "regrettable".
"There are red lines that cannot be crossed when it comes to the territorial integrity of Morocco," Mr Fassi told MPs in Rabat.
Ceuta and Melilla, on Morocco's coast, came under Spanish control about 500 years ago but Morocco claims them too.
High-level Spanish visits to the two strategic enclaves are rare. This is the first time the king has visited as head of state in his 32-year reign.
When Prime Minister Jose Luis Rodriguez Zapatero went there in 2006 it was the first by a Spanish head of government since 1981.
Madrid says the urban enclaves are integral parts of Spain.
They are surrounded by Morocco, which views the Spanish presence as anachronistic and claims sovereignty.
The king is due to visit the second enclave of Melilla on Tuesday but he will return to the Spanish mainland overnight.