The visit, at the invitation of King Mohammed VI, is the first by Juan Carlos outside Spain since he had back surgery in March, and is expected to reflect the close diplomatic ties between Rabat and Madrid.
The two monarchs are due to meet at a dinner banquet .
Also , businessmen from Spain and Morocco will meet to discuss ways of bolstering cooperation between the two countries.
Juan Carlos brought with him to Morocco top business executives, as well as the ministers of foreign affairs, the interior, justice, industry and development.
Foreign Minister Jose Manuel Garcia-Margallo said last week in Madrid the visit was "very symbolic on the political front in light of current developments" in the region and would also focus on economic issues.
Morocco's Deputy Foreign Minister Youssef Amrani praised relations between Morocco and Spain and expected Juan Carlos' visit to open new horizons in bilateral cooperation.
Some 800 Spanish firms operate in Morocco, and Spain was Morocco's first trading partner last year.
The severe crisis that has hit the Spanish economy has seen a noticeable rise in the flow of Spaniards heading to Morocco to live or search of work, experts say.
Official figures show that 2,660 Spaniards registered for social security in Morocco last year, but the numbers actually living and working in the country are believed to be much higher.
Conversely, there are 783,137 Moroccans living in Spain according to a 2013 study carried out by Spanish Muslim peak group UCIDE.
A total of 23,408 Moroccans arrived in Spain in 2012, figures from Spain's national statistics institute (INE) show.
Moroccans are also the third largest group of non-EU nationals living within the Union. There are some 1.9 million people from the North African country living in the EU according to March figures from EU stats body Eurostat.
Many of Spain's Moroccans are currently undertaking the traditional one-month long Islamic fast of Ramadan.
Story continues below…
During this time, Muslims over the age of 14 do not eat, drink, have sexual relations or smoke from sunrise to sunset.
This fast is particularly difficult in summer when the daylight hours are long.
Pregnant women, the elderly, children under 14 and people working in jobs where there is a real risk of dehydration are not obliged to fast.
Spain's UCIDE on July 8th asked Spain's employers to be flexible about working hours for Muslims during Ramadan.
UCIDE President Riay Tatary also told Spaniards to visit a mosque and find out about the traditions of their Muslim neighbours. This would be a "symbol of integtration", he said.