Turkey’s AK party faces a challenge to form a government after losing its majority at a general election for the first time in 13 years.
It secured 41%, a sharp drop from 2011, and must form a coalition or face entering a minority government.
The pro-Kurdish HDP crossed the 10% threshold, securing seats in parliament for the first time.
The Turkish lira and shares dropped sharply on Monday morning as markets reacted to the news.
The Turkish currency fell to near-record lows against the dollar, and shares dropped by more than 8% soon after the Istanbul stock exchange opened.
The central bank acted quickly to prop up the lira by cutting the interest rate on foreign currency deposits.
The election result is a blow to President Recep Tayyip Erdogan’s plans to boost his office’s powers.
He first came to power as prime minister in 2003 and had been seeking a two-thirds majority to turn Turkey into a presidential republic.
Prime Minister Ahmet Davutoglu said: “The winner of the election is again the AKP, there’s no doubt.”
But he added: “Our people’s decision is final. It’s above everything and we will act in line with it.”
The HDP’s supporters were jubilant, taking to the streets to chant “we are the HDP, we are going to the parliament”.
“It is a carnival night,” 47-year-old Huseyin Durmaz told AFP. “We no longer trust the AKP.”
HDP leader Selahattin Demirtas ruled out entering into a coalition with the AKP.
“The discussion of executive presidency and dictatorship have come to an end in Turkey with these elections,” Mr Demirtas told a news conference in Istanbul.
The BBC’s Mark Lowen in Istanbul
The AKP has polled worse than it ever feared and lost its majority. President Erdogan will be unable to change the constitution and extend his powers.
It’s a stark contrast with the HDP, which gambled to run as a single party for the first time, hoping to cross the 10% threshold. It paid off, gaining a significant voice for the Kurdish minority on the national stage.
It succeeded by appealing beyond the Kurds, drawing in leftists and staunch Erdogan opponents with its message of equality, gay rights and environmental concerns.
This could be the start of a new political era here; a major setback for a president who has polarised this nation.
In a volatile Middle East, Turkey matters greatly – and so the path it takes, the nature of its democracy and the leaders it produces, all have implications far beyond its borders.
With nearly all the votes counted, the AKP looks likely to win 258 seats in parliament, 18 fewer than it requires for a majority.
The Republican People’s Party (CHP) looks likely to be the second largest party, as in the previous parliament, polling around 25% of the vote.
In third place is the Nationalist Movement Party (MHP) on 16.5%, with the People’s Democratic Party (HDP) in fourth place with 13%.
The HDP is expected to finish with 75 to 80 seats after attracting votes beyond its Kurdish support base.
Who are the HDP?
- The People’s Democratic Party was founded as a pro-Kurdish party in 2012
- There are 15m Kurds in Turkey – or 20% of the population
- The party has since attracted support across the left
- It had the only openly gay candidate in Turkey’s elections
- A higher proportion of women ran for the HDP than any other party
Many turned out to vote in the HDP’s heartland of Diyarbakir, two days after a bombing in the eastern city killed two people and injured 200 more.
The MHP’s leader Devlet Bahceli did not rule out the possibility of entering a coalition government, but said the results represented the “beginning of the end for the AKP”.
Once viewed as invincible, President Erdogan’s party has been criticised in recent years for its clampdown on free speech and its growing authoritarianism.
After the official result is declared, Mr Davutoglu has 45 days to form a government.
One of his deputies, Numan Kurtulmus, said he believed a government could be formed in that time, but that an early election was possible.
Recep Tayyip Erdogan – key dates
1994-1998 – Mayor of Istanbul, until military officers make power grab
1998 – Islamist Welfare Party banned, Erdogan jailed for four months for inciting religious hatred
Aug 2001 – Founds Islamist-rooted AK Party (Justice and Development) with ally Abdullah Gul
2002-3 – AKP wins solid majority in parliamentary election, Erdogan appointed prime minister
Jun 2013 – Clashes as protesters rally at Gezi Park in Istanbul against AKP’s urban redevelopment
Dec 2013 – Corruption inquiry sparks feud between Erdogan and erstwhile ally, US-based Islamic cleric Fethullah Gulen
Aug 2014 – Becomes president after first-ever direct elections for head of state