Turkish Prime Minister Recep Tayyip Erdogan claimed victory in legislative elections, pledging commitment to the secular system and continued economic and democratic reform.

'Our people decided to continue with our party. It is clear that support for us has increased,' Erdogan told hundreds of party supporters celebrating outside the headquarters of his Justice and Development Party (AKP).

'We will never make concessions from the basic principles of the republic,' he said. 'We will pursue economic and democracy reforms with determination.'

Erdogan pledged that his government would continue to work to boost Turkey's bid to join the European Union.

The AKP, which has its roots in a now-banned Islamist movement, claimed victory with about 46% of the vote, according to unofficial results. This would give it another five-year term in power.

The elections were brought forward from November after political turmoil sparked by accusations that the AKP is seeking to undermine the secular system botched the party's bid to install Foreign Minister Abdullah Gul as president.

Millions of Turks took to the streets to protest at the prospect of an AKP president.

'Our democracy has successfully passed a test,' Erdogan said. 'Our unity, democracy and the republic have emerged stronger from the ballot box.'

He also appealed to voters who did not back his party, saying: 'I understand the message you gave us at the ballot box.

'We respect your decision. Rest assured that, as the first party in this election, we deem it our duty to protect our country's diversity.'