Morocco's moderate Islamists are favoured to win a parliamentary election on Friday, five years after they entered government when the kingdom introduced limited reforms in the wake of Arab Spring protests calling for change.
The Justice and Development Party (PJD), which has led the ruling coalition since 2011, is seeking to retain office in the ballot against its main rival, the Authenticity and Modernity Party (PAM), which opponents say is too close to the palace.
When the Arab Spring uprisings convulsed the region, Morocco's royal palace introduced limited reforms granting more powers to parliament. But the king retains most executive authority and no party openly challenges the monarchy.
Voters will select lawmakers for the 395-seat House of Representatives. The palace will then appoint the prime minister from the party that wins most seats.
Under the electoral system, no one party can win an outright majority, forcing winners into a drawn-out process of negotiations to form a coalition government.
Popular for its anti-corruption stance, Prime Minister Abdelilah Benkirane's PJD has pushed fiscal reforms to reduce Morocco's deficit and overhaul a system of heavy subsidies, a programme he says will continue if the PJD is re-elected.
"I voted for the PJD because I want to give them a chance to finish what they started," said Hamza Saidi, a pensioner casting his ballot in the capital Rabat.
Opinion polls are banned, but most analysts say they expect the PJD to dominate after its performance in last year's municipal elections, when it won major cities for the first time. PAM also did well, especially in rural areas.
The Interior Ministry said turnout was around 30 percent by 1600 GMT, two hours before closing. Early results were expected later on Friday.
Campaigning was marked by accusations that the royal establishment, uneasy about sharing power with Islamists, was unfairly backing PAM as a way to roll back PJD influence.
On Friday, the PJD accused local officials under the control of the Interior Ministry of trying to influence voters. The ministry has dismissed some claims and said it would investigate others.
"Our central election committee is worried about reports of local authority officials trying to influence the will of voters toward one party. It is also concerned about reports of officials filling ballot boxes with votes for one party," a PJD statement said.
PAM, whose founder is a close ally of the king and a royal adviser since leaving the party, has promised to review PJD reforms, especially a contested pensions overhaul. PAM presents itself as a liberal alternative to the Islamists.
More than 30 political parties are running, but only the conservative Istiqlal party, which quit the PJD government in 2013, has the national reach of the PJD and PAM.
"It's hard to judge, but from what we have observed, the PJD looks to be the favourite," said Mohamed Madani, a political scientist at Rabat University. "Let's hope it is a transparent vote so we can see the real tendency."
Other groups, including the Islamist Justice and Spirituality party and leftist organisations, are boycotting the vote because the monarchy retains most powers.
King Mohammed won international praise for improving the country's human rights record after coming to the throne in 1999, but critics say rights groups still face harassment and that the establishment has let slide promises made in 2011 of more tolerance.