Updated

Turkey's ruling party won a third term in parliamentary elections Sunday, setting the stage for the rising regional power to pursue trademark economic growth, assertive diplomacy and an overhaul of the military-era constitution.

However, results indicated that the Justice and Development Party of Prime Minister Recep Tayyip Erdogan had not won a two-thirds majority in parliament, a shortcoming that would force it to seek support for constitutional change from other political groups.

With 99 percent of votes counted, Erdogan's party had won 50 percent of the votes, according to TRT, the state-run television. It said the Republican People's Party, the main opposition group, had 26 percent of the vote.

TRT said another opposition party, the Nationalist Action Party, had 13 percent of the vote, signaling it would stay in parliament by crossing a 10 percent vote threshold designed to keep out smaller parties.

According to the tally, the ruling party had won 326 seats in the 550-seat parliament, a comfortable majority that would ensure the continuation of its single-party rule. It had 331 seats in the outgoing parliament. Lawmakers serve four-year terms.

Several thousand supporters gathered Sunday night outside the ruling party headquarters in Ankara, chanting pro-government slogans and waving Turkish flags as Erdogan emerged to deliver a victory speech from the balcony.

The prime minister alluded to the climate of impunity and political chaos that prevailed in past decades in Turkey, which endured several military coups but has made strides in democratic development as part of its bid to join the European Union.

"The Turkey that was directed by the gangs is a thing of the past," said Erdogan. Despite Turkey's achievements during his tenure, Erdogan is viewed with skepticism by the opposition and some commentators who note slowing reforms and hints of an autocratic leadership style.

"We will be humble. We have never displayed pride or boasted," Erdogan said in an apparent attempt to counter the criticism. He pledged to start work on enacting a new constitution.

"We will be seeking consensus with the main opposition, the opposition, parties outside of parliament, the media, NGOs, with academics, with anyone who has something to say," he said.

About 50 million Turks, or two-thirds of the population, were eligible to vote. NTV television said turnout was 84.5 percent.

For the first time, voters cast ballots in transparent plastic boxes in which the yellow envelopes could be seen piling up. The measure was designed to prevent any allegations of fraud. In past elections, wooden boxes were used.

The Anatolia news agency reported that police detained 34 people in the southeast province of Batman for allegedly trying to coerce people into voting for the Peace and Democracy Party, a Kurdish party accused by officials of links to Kurdish rebels.

The party fielded independent candidates to work around the 10 percent vote threshold for Turkey's parliament. It seeks more rights and autonomy in the southeastern strongholds of the ethnic minority, which makes up about 20 percent of Turkey's 74 million people.

Turkey, a NATO ally with a mostly Muslim population, stands out in a region buffeted by popular uprisings as a rising power with traditional Western alliances as well as growing ties in the east and elsewhere. In the past decade, the government has sharply reduced the political clout of the military, and taken some steps to ease restrictions on minorities, though reforms have slowed in recent years.

Despite its successes, Turkey's government faces opposition accusations that it seeks to consolidate power at the expense of consensus-building.

Erdogan has promised that a new constitution would include "basic rights and freedoms," replacing a constitution implemented under the tutelage of the military in 1982. However, he has provided relatively few details on a possible new draft.

The government has Islamic roots, long a source of suspicion among secular circles that once dominated Turkey and fear that Erdogan seeks to impose religion on society.

Turkey's leaders describe themselves as moderates and "conservative democrats" who are committed to the ideals of Western-style democracy. After winning election in 2002, they implemented economic reforms that pulled the country out of crisis. The growth rate last year was nearly 9 percent, the second highest among G-20 nations after China.

Still, political reforms faltered in the ruling party's second term. Turkey's bid to join the European Union has stalled, partly because of opposition in key EU nations such as Germany and France. Critics point to concerns about media freedom and the Turkish government's plans for Internet filters as signs of intolerance toward views that don't conform to those of Turkey's leadership.

Four people were detained Sunday in the southeast province of Sanliurfa for allegedly voting more than once with other people's ballot papers. In the capital, Ankara, police fired in the air and used pepper spray to break up scuffles at a polling station where a group of voters wrongly accused another group of having fake ballot papers, the Anatolia agency said.

For all of Turkey's challenges, Sunday's vote was an indicator of stability in an increasingly confident country. Most voting was peaceful and orderly, with large crowds gathering early to cast ballots.