Spain's new King Felipe VI arrived in Rabat on Monday for the start of his first trip to neighbouring Morocco since acceding to the throne in June.
The monarch, accompanied by his wife Letizia on his third official trip abroad, after the Vatican and Portugal, was met at the airport by King Mohammed VI and his wife Lalla Salma.
They then headed to the palace for an official ceremony, official media reported.
Also present at the ceremony were the Spanish Foreign Minister Jose Manuel Garcia Margallo and his Moroccan counterpart Salaheddine Mezouar.
On Tuesday Felipe VI is due to meet Moroccan premier Abdelilah Benkirane and will then inaugurate a tourism training centre, accompanied by Mohammed VI, while his wife will visit a cancer research centre.
The 46-year-old Spanish king took the throne on June 19, after the abdication of his father Juan Carlos, who visited Rabat in 2013.
Spain ruled parts of Morocco and the Western Sahara during the colonial era, and still holds its two North African territories of Ceuta and Melilla on the Mediterranean, despite the longstanding objections of Rabat.
But the neighbours have enjoyed good relations in recent years -- Spain is Morocco's top economic partner alongside France -- and Madrid and Rabat signed a new cooperation accord in June worth 150 million euros, for the period 2014-2016.
They have also worked together closely to deter the rising number of illegal sub-Saharan immigrants trying to reach Spanish soil.