By Sarah Rainsford
BBC News, Ankara
Unofficial results prompted wild street celebrations by supporters
Turkey's powerful military warned it would intervene to protect the republic, if required.
This Sunday, 46.4% of the electorate cast their votes for the AKP across the country, proving they did not believe in any such danger.
It was a resounding victory and, as the results rolled in, there was euphoria at the brand new party headquarters in the city.
Hundreds of people thronged outside, waving orange and blue party flags.
There was singing and dancing in the streets. Passing cars were draped in party flags too, passengers hanging out of the windows.
"It is very exciting. It will be very good for Turkey," said Sadi, one of the supporters.
He voted for the AKP so democratic reforms would continue, moving Turkey closer to the European Union.
But the AKP has its roots in political Islam.
So does this second term success mean Turkish society is becoming more religious and more introverted? Sadi disagreed.
"Today nearly half of the people voted AKP, and half of all people here do not want Turkey to be an Islamic society," he explained.
"I don't want that. I want more democracy."
From a balcony overlooking the crowd of supporters, Prime Minister Recep Tayyip Erdogan said Turkey's democracy had "successfully passed a test".
"Our unity, democracy and republic have emerged stronger from the ballot box," he added.
Dogu Ergil, a political analyst, says the AKP's victory was "a vote for stability and continuity".
It was also helped significantly by a feel-good factor created by the economy doing well, and the failure of the main opposition parties to unite against the AKP.
Military 'squeezed'
But for many Turks, the strong AKP showing at this general election was primarily a backlash against the role of the military and secular establishment in the controversial presidential vote earlier this year - that is what sparked the entire crisis.
Turkish voters give their verdict on the election result
In pictures
"This election sends a very clear signal to the military and the bureaucracy not to meddle," analyst Ihsan Dagi says.
"In that sense, I think the result is a slap in the face for the military."
Newspaper columnist Burak Bekdil agrees that Turkey's generals, who paint themselves as the protectors of the republic, will be unable to intervene any further without losing legitimacy.
"The military will feel squeezed by this election - they can't act against such a large majority," he says.
"That will really limit their room for manoeuvre against what they see as an Islamist threat to Turkey's constitutional regime."
Presidential dilemma
When it is time for the new parliament to try again to elect a president, AKP leaders will be under great pressure from the party faithful to nominate Mr Gul once again.
Secularists say Abdullah Gul has a hidden Islamist agenda
When he appeared with his wife at party headquarters on Sunday, the crowds shouted: "Gul for president".
But Professor Ergil does not believe the party will nominate the foreign minister again.
"They won't want to jeopardise their new legitimacy," he says.
"There are other people they can nominate. This party is new and it's learning all the time."
Like many here, Professor Ergil believes the AKP has moved to the centre of the political playing field in Turkey.
That is a dramatic U-turn from its leaders' Islamist past - the reason some Turks still do not trust them.
An opposition supporter, Fadik, claims the AKP are against the republic.
"They are not following the path of our great leader, Ataturk - they're completely against him," she says.
"Instead of moving forwards, Turkey is going backwards in every way."
Another, Deniz, believes Turkey's secular society is already changing.
"This high percentage vote for them is dangerous," she says.
"We didn't used to see women wearing chadors on the streets before. Covered women didn't used to give you condemning looks."
But the fears of people like Deniz failed to keep the AKP from power.
And now they are back with a stronger mandate than ever.
That could mean this whole crisis is resolved, or it could mean phase two has just begun.
The Justice and Development Party (AKP) in Turkey secured a solid mandate in Turkish general election, held yesterday. Although Prime Minister Recep Tayyip Erdoğan could celebrate getting 46.5% of the vote, more than 12% better than the last poll in 2002, his party will have to settle for slightly fewer seats in Turkey's parliament, the Grand National Assembly of Turkey. AKP will now have 340 seats versus 353 formerly.

Before a cheering crowd, Erdoğan said yesterday: "We've passed an important test of democracy that is an example to the world. The people have pronounced the Justice and Development Party as the central political power in Turkey."
Abdullah Gül in 2005 
AKP called this election, ahead of schedule, after opposition parties boycotted the vote on AKP's presidential candidate, Abdullah Gül, and the Constitutional Court annulled the result. Speaking about the issue of the presidency, Erdoğan told a news conference: "We will resolve this matter without causing tensions."

United Kingdom Foreign Secretary David Miliband, said: "It's very important that across Europe we reach out to the new government in Turkey when it is formed. A stable and secure Turkey is massively in our interests."

In Washington, spokesperson Tony Snow said: "It was a free and fair election, and Turkey remains an important ally of the U.S."

EU Enlargement Commissioner Olli Rehn said the government must move forward on reforms as EU entry talks have stalled. "We expect the new government will be formed swiftly. It is essential that the new government will re-launch the legal and economic reforms with full determination and concrete results," he told reporters.

The Nationalist Movement Party (MHP), saw the greatest growth in support. Although in 2002, they pulled nearly 6% in support it was not enough for any seats. The 14.3% achieved in this election, got the MHP 71 seats. The general secretary of the party said it won't seek to create tensions.

The Republican People's Party (CHP) was dealt the biggest setback in the election. CHP saw an erosion in support that cost them 66 seats, leaving them with 112. 

"The only danger at the moment is failure to reach an accord over the presidency," said election observer and columnist for Hürriyet, Erdal Saglam.