Thais awaited the results Sunday of a referendum on a new constitution that, if accepted, would lay the foundation for a civilian government influenced by the military and controlled by appointed rather than elected officials.

The referendum is also seen as a test of popularity for the military government of Prime Minister Prayuth Chan-ocha, a retired army general who came to power in a 2014 coup and has severely curtailed dissent since then. But his rule has also brought a measure of stability and ended the frequent street violence and divisive politics that had frayed Thailand's social fabric for years.

This veneer of stability could well help Prayuth win a "yes" vote for the new constitution. Three independent polls taken before Sunday's referendum showed the draft winning approval comfortably.

One poll conducted between Aug. 2 and 6 had 76.9 percent "yes" votes, while the other two had 61.3 percent and 57.3 percent voicing approval. The results were released Sunday after voting in the referendum ended because of a ban on any activity that could influence voters, including bans on political rallies and independent campaigns.

Open criticism of the draft constitution was made punishable by up to 10 years in prison, and more than 100 people who tried to campaign against the referendum on social media were thrown in jail.

Opponents say this was done to ensure that people would have little knowledge about the constitution's provisions, even though officials say 1 million copies were distributed. Some 50 million voters were registered ahead of Sunday's referendum.

Counting of votes began immediately after voting ended. Early results for Bangkok — reported by Nation TV and based on results from individual polling stations — showed 60-75 percent in favor of the draft constitution, not surprising given the heavy support the military has among the capital's residents.

"If you say 'yes' to the constitution, it means you agree with the content of the constitution ... what makes matters worse is you also give legitimacy to the coup, to the coup makers," said Pavin Chachavalpongpun, an associate professor at the Center for Southeast Asian Studies of Kyoto University in Japan.

Pavin, a Thai and a vocal critic of the junta, told The Associated Press that a victory in the referendum would give the junta the reason to tell the world "don't you dare criticize us anymore because we have the legitimacy."

Even if the constitution does not win approval, the military will remain in control for the foreseeable future. Prayuth has promised to hold elections next year, without elaborating on how that would happen if voters reject the constitution.

In Bangkok, student activist Piyarat Chongthep tore up his ballot while shouting "Down with dictatorship and long live democracy." Destroying a ballot is illegal, and he was arrested. At least 20 other people were detained for destroying their ballots, apparently accidently because they were confused about the voting procedure.

The main criticisms of the draft constitution are:

— A transition period of at least five years to civilian rule.

— A 250-member appointed Senate that includes the commanders of the army and other security services.

— A deadlock in the 500-member elected lower house could trigger a selection of a prime minister who is not an elected member of parliament. Under the abolished 2007 constitution, half the Senate was elected, and the prime minister had to come from the lower house.

— Emergency decrees enacted by the junta without any parliamentary consent remain valid.

Thailand has endured 13 successful military coups and 11 attempted takeovers since it replaced an absolute monarchy with a constitutional one in 1932. If passed, this would be Thailand's 20th constitution.

Leaders of the latest coup say frequent political conflicts had made the country ungovernable and that military rule was necessary for stability. The junta set up hand-picked committees to draft a charter that would enshrine its declared goal of reforming politics by eliminating corruption.

But others believe the draft constitution has a different aim: to weaken allies of former Prime Minister Thaksin Shinawatra, the central figure in the roiling of Thai politics.

Thaksin easily won every national election since 2001, with the support of working-class and rural voters who benefited from his populist policies. Leading the other side is Thailand's traditional ruling class and royalists — known as the "yellow shirts" — unnerved by Thaksin's support, especially as it contemplates its future. King Bhumibol Adulyadej, whose righteous rule has anchored the kingdom since 1946, is 88 and ailing.

The army ousted Thaksin in a 2006 coup, after "yellow shirt" protesters took to the streets and accused him of abuse of power, corruption and disrespecting the king. He has lived abroad since 2008 to avoid prison for a corruption conviction that he says was politically motivated. The 2014 coup ousted his sister Yingluck Shinawatra, who was elected prime minister in 2011.

Those who brought Thaksin down now seek to weaken major political parties, which would ensure that real power stays in the hands of what is dubbed the permanent bureaucracy: the military, the courts and other unelected guardians of the conservative bloc.

___

Associated Press journalists Grant Peck, Jerry Harmer, Tassanee Vejpongsa and Penny Wang in Bangkok and Ken Moritsugu in Tokyo contributed to this report.