Turkey's Prime Minister Ahmet Davutoglu has declared victory for his ruling party after preliminary election results showed it restoring its majority in parliament.

State-run TRT television reports that with more than 97 percent of the votes counted, the ruling Justice and Development Party, or AKP, has won just above 49 percent, which would comfortably restore its ruling majority.

"Today is the day of victory but it is also a day for humility," Davutoglu said, addressing supporters in his hometown of Konya, where he voted.

The preliminary results suggest that the ruling party's gamble to hold new elections has paid off. Supporters at the party's Ankara and Istanbul headquarters were already waving flags in rapturous celebrations. Crowds outside President Recep Tayyip Erdogan's home in Istanbul were shouting "Turkey is proud of you."

The vote is a rerun of a June election in which AKP surprisingly lost its one-party rule due to a strong showing by a Kurdish party. Most analysts had expected AKP to fall short again, but the preliminary results suggest it picked up millions of votes at the expense of the nationalist MHP and pro-Kurdish People's Democratic Party, or HDP. AKP's vote tally jumped nearly nine percentage points. The secularist CHP was hovering around the same result as in June.

Following the June vote, renewed fighting between Turkey's security forces and Kurdish rebels left hundreds of people dead and shattered an already-fragile peace process. Two recent massive suicide bombings at pro-Kurdish gatherings that killed some 130 people, apparently carried out by an Islamic State group cell, also increased tensions. Following the vote Sunday, small clashes broke out in Diyarbakir in the Kurdish southeast between protesters and police.

Turkey is a key U.S. ally in the fight against IS and, since it hosts more Syrian refugees than any other nation in the world, a crucial player in efforts to end the war in Syria and resolve Europe's massive immigration crisis.

Davutoglu had called on voters to choose stability and give AKP a new majority, while opposition parties had hoped to force him into forming a coalition.

Turnout was about 87 percent among the 54 million people eligible to vote at more than 175,000 polling stations.

Turkish Deputy Prime Minister Numan Kurtulmus of the AKP said the preliminary result indicated that voters wanted stability.

"The people wanted calm, they wanted security, they didn't want their peace disturbed," Kurtulmus said.

Erdogan was not on the ballot, but the election will determine if he can continue to be Turkey's primary political power by guiding the ruling party in parliament.