It was just 14 months ago that then opposition leader Mariano Rajoy's name was booed by crowds in the streets of Rabat and accused of "attacking the dignity" of Morocco by former Prime Minister Abbas el Fassi when he paid a controversial visit to the Spanish city of Melilla.
On Wednesday, as the prime minister of Spain, Rajoy was greeted by a guard of honor on his first official visit abroad since taking office last month.
Declaring himself a "friend of Morocco" and pledging to open "a new era" of bilateral relations with Rabat, Rajoy seemed to hit it off with Prime Minister Abdelilah Benkirane and King Mohammed VI, both of whom he met during a seven-hour stay.
Islamist leader Benkirane, who like Rajoy assumed office after elections last November, said that he found in the Spaniard an interlocutor who is "friendly, amiable and very capable."
"Write that down!" Rajoy joked with journalists, although in keeping with his reticence in front of the media, no questions were permitted during the joint news conference. The prime minister praised the Moroccan monarch as an "example to follow" for his commitment to pushing through democratic reform and said that Spain's neighbor "is at the vanguard of the Arab world."
Analyzing the rapport between Rajoy and Benkirane, the editor of Moroccan daily Al Massae, Abdellah Damoun, highlighted the similarities between the two leaders: both sport beards, they are of similar age, both are conservative and religious and each was close to power when terrorist attacks ? the 2004 train bombings in Madrid and the 2003 attacks across Casablanca, carried out by groups with links to Al Qaeda ? turned public opinion at a crucial moment before elections.
Rajoy's trip continued the tradition of an incoming premier traveling to Morocco before any other country. His next official engagement on foreign soil is a meeting with Angela Merkel in Germany on January 26.