By Amy Sawitta Lefevre and Panarat Thepgumpanat

BANGKOK (Reuters) - A democratically elected government will take power in Thailand at the earliest by December 2017, a senior Thai official said on Monday, after the country endorsed a military-backed constitution paving the way for a general election.

Thais handed the junta of Prime Minister Prayuth Chan-ocha a convincing win in the referendum on Sunday, with preliminary results showing over 61 percent voted in favor. Full results are due on Wednesday.

A desire to see greater political stability drove the yes vote, analysts said. Thailand has been rocked by more than a decade of political turmoil that has stunted growth, two military takeovers and several rounds of often deadly street protests.

"We think there will be an election at the earliest in September or October 2017, and a new government by December 2017," Chatchai Na Chiang Mai, spokesman for the Constitution Drafting Committee, told Reuters.

Deputy Prime Minister Wissanu Krea-ngam on Monday also said an election will take place in 2017, confirming the timeline Prayuth laid out ahead of the referendum.

Prior to the vote, Thailand's major political parties had criticized the draft constitution, saying it would constrict democracy, including one provision calling for an appointed Senate with seats reserved for military commanders.

In Washington, a State Department spokeswoman urged Thai authorities to take steps to return the country to an elected, civilian-led government as soon as possible.

"We strongly urge the government to lift restrictions on civil liberties, including freedom of expression, the right to peaceful assembly," spokeswoman Elizabeth Trudeau said in a news briefing.

Few countries have had more constitutions and drafters have historically failed to produce anything lasting. Thailand has issued 19 constitutions since a constitutional monarchy replaced an absolute one in 1932.

Members of the anti-junta opposition say they are biding their time until the 2017 election when, if a party they back takes power, they can try to scrap the military charter.

"We accept the result of the referendum and will wait and see what happens in the 2017 election," said Jatuporn Prompan, chairman of the United Front for Democracy Against Dictatorship.

"We will decide our next steps soon," he said.

Opposition to the junta was muted ahead of the vote in Thailand's northeast, once a hotbed of resistance.

ELECTING PRIME MINISTER

A second ballot question that would allow the Senate to elect a prime minister jointly with the lower house was also winning by a wide margin.

"Although many suspected that the new charter could undermine their previously held democratic rights, the perceived risk of greater political uncertainty and economic instability, if the constitution had been voted down, was far less appealing," said John Marrett, Research Analyst Asia at the Economist Intelligence Unit.

Interviews with military officers showed the military's ambition was to make future coups unnecessary by weakening political parties and obliging future governments to follow a 20-year national development plan set by the army.

The referendum result would legitimize the junta's bid to extend its hold on power through the constitution said Sunai Phasuk, Thailand researcher at Human Rights Watch.

"It will embolden junta leader Prayuth to think he has millions of Thais behind him and it will extend military control not for one or two years but 20 years," Sunai told Reuters.

Thai investors welcomed the result on Monday and the Thai stock market touched a fresh 16-month high.

The 'yes' vote would be positive for the economy and investment in the second half of 2016, Bank of Thailand Governor Veerathai Santiphrabhob said on Monday.

STILL DIVIDED

Thailand has been divided for more than a decade between rival camps. One of them is led by former populist premier Thaksin Shinawatra, who was toppled in a 2006 coup and later went into self-exile.

The Puea Thai Party, which carried his sister Yingluck to power in a 2011 election, was removed from office in the 2014 coup.

Pitted against Thaksin and his allies is the royalist and military establishment which accused him of nepotism and abuse of power, accusations he denied.

Thaksin's supporters credit him with recognizing the inequality between urban Bangkok and the poor in the rural north and northeast.

Preliminary results show the northeast, a Thaksin stronghold, the far north and the three Muslim-majority southern provinces, where an insurgency has raged since 2004, voted against the draft.

The results show Thailand remains divided, said Sunai at Human Rights Watch.

"In the south this is a denial of control of the Thai Buddhist state. In the northeast, it reflects how, regardless of the junta's attempt to dismantle the Puea Thai machinery, hearts are still with Thaksin."

(Additional reporting by Aukkarapon Niyomyat, and Ruthy Munoz in Washington; Writing by Amy Sawitta Lefevre; Editing by Bill Tarrant and Alan Crosby)