The massively towering Hassan II mosque in Casablanca sits on the edge of Africa, looking serenely across the waters to the new world beyond. This impressive architecture — as I watch from its terrace the sun sink into the Atlantic — stands for the newly confident Morocco as the westernmost anchor of Islam.

Here in Casablanca, the north and south, the west and east intersect in a burst of sound and colour that speaks for fusion rather than clash of civilizations.

I am surprised by the overflow of energy of some 6 million people in this city that by name will remain associated with Hollywood’s all-time favourite 1942 Humphrey Bogart movie Casablanca. And Rick’s Cafe — the saloon made famous in the movie — which opened in 2004, a short walking distance from the grand mosque and a popular meeting place for Moroccans and tourists with a love for music and fine food.

Morocco, unlike its North African neighbours Algeria and Libya, has no petroleum or natural gas. Ironically the relative success of the Moroccan economy is related to this fact, making it Africa’s largest agricultural producer.

The country is open for business and eager for investment from abroad. The construction boom in Casablanca and Rabat, the capital, is indicative of the flow of offshore money into the economy.

Tourism is a huge part of the success story of Morocco. It reflects the openness of the people to foreigners and their instinctive understanding of how closely tied their well-being is with the world outside.

Morocco is a blend of the traditional and the modern. The relative success of the Moroccan economy and society — compared to the recent violent history of Islamist terrorism in Algeria or the repressive one-man demagogic rule of Libya’s strongman Moammar Gadhafi ­— is in part the story of monarchical rule providing for stability and tolerance in a country of mixed races, Arabs and Berbers.

It is this openness to the West, through Rabat’s strategic links with France, that Islamists connected with al-Qaida find intolerable or worse, an embrace of the infidels. The May 2003 bombings in Casablanca by al-Qaida associates were directed at undermining this fruitful relationship.

As an open society, Morocco is vulnerable to Islamist threats. But I find in my conversations with people here, limited though these may be, there is little support for the sort of politics in the Mashreq — the Arab east — that has politically retarded the Arab world despite its resources.

The future of any developing country in Africa or Asia is tied with the young and how the women and the minorities there are treated.

I sense Morocco can follow the example of post-war Japan where the monarchy’s role in transition from militarism to democracy under the guidance of the United States has been a grand success.

The role of monarchy here appears for all purposes to provide for guided transition to modernity, including democracy.

It also appears that the young and the women accept this role of their royal family without open resentment, and they are more or less content with an acceptance of modernity that does not demand a break with the past. This speaks well for Morocco’s future.