New constitution the monarch's response to demands for greater freedoms resulting from the Middle East unrest

Moroccans voted on Friday on whether to adopt a new constitution that the king has championed as an answer to demands for greater freedoms – but that protesters say will still leave the monarch firmly in control.

The referendum on the constitution is near certain to result in a resounding yes vote, like all past referendums in this North African country and generally throughout the Arab world.

It is buoyed by a huge media and government campaign, and is seen by some as a way to tentatively open up Moroccan politics, while heading off the kind of tumultuous regime change seen elsewhere in the region.

Some voters at the country's nearly 40,000 polling stations described the ballot as a vote of confidence in King Mohammed VI, a 47-year-old who assumed the throne in 1999 and is seen as a relatively modern monarch.

Preliminary results are expected after polls close Friday night.

A popular tourist destination, the generally stable, Muslim kingdom is a staunch US ally in a strategic swath of northern Africa that has suffered terrorist attacks – and in recent months, popular uprisings against autocratic regimes.

Morocco, like the rest of the Middle East, was swept by pro-democracy demonstrations at the beginning of the year, protesting a lack of freedoms, weak economy and political corruption.

The king, however, seems to have managed the popular disaffection by presenting a new constitution that guarantees the rights of women and minorities, and increases the powers of the parliament and judiciary, ostensibly at the expense of his own.

Protests have continued nevertheless, and the 20 February pro-democracy movement has called for a boycott. It insists that the new constitution leaves the king firmly in power and will be little different from its predecessor.

Their voices have been drowned out as nearly every political party, newspaper and television station has for the past several weeks pressed for Moroccans to vote in favour of the constitution.

The monarch was among those voting, casting his ballot in a chic Rabat neighbourhood and, like every other voter, his voting card and ID were checked against the list. He voted with his brother, Prince Moulay Rachid.

Crowds were small but steady at voting stations in a working class neighbourhood of Sale, outside the capital, Rabat.

Voters were given two pieces of paper – one for a yes vote and one for a no vote – and placed one in an envelope which they put into the urn. The yes ballot was white, and the no ballot light blue, so that illiterate voters could participate.

In the Moroccan countryside, voter turnout was stronger in the morning, before a searing heat descended. Officials at different voting stations said turnout was around 25% to 35% by late morning.

Cafile Roqiya, a 54-year-old in glasses and a headscarf in the town of Benslimane, said she was voting yes "because there has been much progress". "It is much better than before. The king keeps us stable and at peace amidst much upheaval," she said.

On the eve of the referendum, a pro-democracy demonstration of a few hundred people was swamped by thousands of government supporters who had been bussed in for the occasion wearing matching T-shirts supporting the constitution.

The activists had to take refuge in a gas station under the protection of police while they were hounded by raucous pro-government demonstrators who threw eggs at them and called them "traitors" and "agents".

During the weekly prayers on 24 June, imams in the mosque read out sermons issued by the government urging Moroccans to vote yes as an act of faith.

In cities around the country, banners paid for by local merchants exhort people to come out and vote, a practice seen throughout the Arab world when governments call a referendum and local businessmen want to stay in the good graces of officialdom.

Most observers agree that the real signs of change for Morocco will come with how the new constitution is implemented.

"We say yes to the constitution, but how it turns out in practice, well that's another struggle," said Saadeddin al-Othmani, a top official in the Islamist Development and Justice party, which like most political parties supports the new constitution.

Al-Othmani sees it as a beginning of reform and Morocco's own way of responding to the Arab Spring – not by toppling their leader or repressing the people, but through gradual measures.

The February 20 movement, and the groups that support it, including smaller labour unions, leftist parties and the country's banned Justice and Charity Islamist movement, lack al-Othmani's faith in the process.

They see the king's 9 March speech and three-month consultation period before the new constitution was presented 17 June as the latest in a long line of cosmetic touches to an absolute monarchy.

"We want to liberate the country from the state's monopoly on politics and economy," said Mohammed Lekrari, a leader of the Democratic Confederation of Labour, a union representing around 800,000 public sector workers. "We would like to leave the Middle Ages."

There is a whiff of medieval in the frenzied hype around the need for a yes vote, says his colleague Othmane Baqa, because a vote for a constitution is being seen as a vote for the king – like the oath of allegiance, the "baya," given to Muslim kings for hundreds of years and still practiced annually in Morocco.

"They want this baya through the referendum, so all Morocco must swear allegiance," he said. "It becomes a vote for unity and the king."