Alexis Tsipras was hugged by supporters as he arrived at party HQ
Alexis Tsipras has hailed a "victory of the people" after his left-wing Syriza party won Greece's fifth election in six years.
He said Greeks faced a difficult road and that recovery would only come through hard work.
The conservative New Democracy party earlier conceded defeat.
With half the votes counted, Syriza is projected to be just short of a majority but the Independent Greeks have agreed to join a coalition.
The latest figures give Syriza 35% of the vote, compared with New Democracy's 28%.
The snap election was called after Syriza lost its majority in August. This followed the signing of an unpopular new financial bailout deal with international creditors.
Turnout in this poll was just over 55%, down from 63% in January and low by Greek standards.
Mr Tsipras said his decision to call an early election was vindicated and that he had been given a clear, four-year mandate.
He said he would form a government with the nationalist Independent Greeks.
"Together we will continue the struggle we began seven months ago," he said.
New Democracy leader Vangelis Meimarakis earlier conceded defeat to Mr Tsipras, saying: "I congratulate him and urge him to create the government which is needed."
New Democracy leader Vangelis Meimarakis offered his congratulations to Mr Tsipras
Syriza supporters celebrate at the party's electoral HQ in Athens
Panos Kammenos said his Independent Greeks would join a coalition with Syriza
Syriza supporters at the party's electoral headquarters in Athens earlier cheered and clapped as exit polls were announced.
Mr Tsipras was hugged by party supporters as he arrived there.
The latest projection gives Syriza 144 seats in the 300-seat parliament, with New Democracy on 75. This is only five fewer than Mr Tsipras's thumping victory in January's election, but again leaves him just short of an absolute majority.
29 Dec: Greek parliament fails to elect president, leading to snap elections a month later
25 Jan: Leftist Syriza party's Alexis Tsipras elected PM on an anti-austerity manifesto
24 Feb: Greece's European lenders agree to extend its second bailout by four months
Jun: Marathon talks take place to avoid Greece bankruptcy and possibly leaving the eurozone. PM Tsipras calls a referendum on a possible bailout agreement
5 Jul: Greek voters overwhelmingly reject terms of third EU bailout in referendum vote
14 Aug: Greece agrees €85bn (£60bn) bailout deal with its creditors - its third in five years - allowing tax hikes and new spending cuts. Mr Tsipras resigns a week later clearing the way for snap elections in September, as he seeks a new mandate
20 Sept: New Democracy concedes election defeat to Syriza
However, the leader of the Independent Greeks, Panos Kammenos, said: "With Alexis Tsipras as prime minister we will form a government that will take Greece out of [austerity bailouts]."
The BBC's Richard Galpin says this appears to be a much bigger victory than expected, but Mr Tsipras will still face tough choices on the big reforms required for the economy.
The far-right Golden Dawn is set to be the third biggest party, with 7.1% of the vote.
Mr Tsipras seemed to lose popularity when signing the bailout deal, shortly after holding a referendum in which more than 60% of voters rejected the austerity measures creditors wanted to impose.
In interviews leading up to the election, Mr Tsipras said he had put his country above his party. He said that had he not agreed to the three-year bailout, Greece would probably have had to leave the eurozone.
The decision led to a split within Syriza, with rebels breaking off to form the new Popular Unity party, which advocates withdrawal from the euro. Initial results suggest the party may not win any seats in parliament.