The Justice and Development Party won the most votes Friday in a national election prompted by the pro-democracy demonstrations that swept this North African kingdom of 32 million earlier this year as part of the region-wide Arab Spring.
King Mohammed VI received Abdelilah Benkirane, secretary-general of the Justice and Development Party (PJD), in the mountain town of Midelt on Tuesday and named him head of government with the task of forming a governing coalition.
It would have been unthinkable just a year ago for a member of the opposition PJD to lead the government, but the Arab Spring movement forced the king to reform Morocco's constitution and hold early elections.
Under the amended constitution, the prime minister is now a more powerful "head of government" and he must come from the party that won the most votes in the election. The PJD took 107 seats out of the 395 in Parliament, almost twice as many as the second-place finisher.
With its outsider status, the PJD is expected to test the limits of the newly empowered prime minister's position.
The party is considered quite "moderate" on the spectrum of Islamist groups and it has not focused on issues like women's headscarves or the sale of alcohol in a country that relies heavily on tourism from Europe.
The party has instead talked about fighting rampant corruption, reforming the education system so it readies people for the job market, and combating widespread unemployment.
With the fall or weakening of Western-backed secular dictatorships, people across North Africa have been turning to opposition Islamist parties as an alternative.
The PJD's victory follows that of Tunisia's Islamist Ennahda Party in an election there last month. And voters in Egypt are currently turning out in droves for an election there that is expected to boost Islamist parties.
Benkirane, who was elected head of his party in 2008, leads its more conciliatory pro-monarchy faction and has repeatedly stated his support for a strong king, even while his colleagues would prefer a less powerful ruler.
"The head of the state is the king and no one can govern without him. If someone can do it, it is certainly not Abdelilah Benkirane," he told cheering supporters Sunday after election results showed his party's strong finish.
Only 6 million people out of a potential electorate of 21 million voted in Friday's election and many boycotted out of disgust or apathy with what is perceived as a corrupt political system.
Politics in Morocco has long involved coalition governments made up of several weak parties, dominated by an all-powerful king and his unelected advisers. Bringing in an opposition party to run the government has been used before by the monarchy as a way of restoring its legitimacy.
"The PJD is aware that the political situation in Morocco is very tense," said Benkirane on Sunday. "I promise a strong government that will give hope to Moroccans." He added that ministers would be chosen for their competence and not just political affiliations.
In the past, however, when the opposition has joined the government, little has changed and the public has soon lost faith in it as well. After the venerable left-of-centre Union of Progressive Socialist Forces joined the government in 1997, it soon was perceived as just another party currying favour with the palace.
Benkirane told The Associated Press in an interview before elections that the Makhzen, the code word for the royal establishment that controls all, must realize that the old games must change in the face of a new political environment.
"The Makhzen will have to become a bit reasonable. It must understand that it can sacrifice the political parties and the PJD, but that will not resolve the problem," he said.