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 from financial crisis would only come through hard work.
The conservative New Democracy party earlier conceded defeat.
With 60 percent of 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 percent of the vote, compared with New Democracy's 28 percent. The far-right Golden Dawn is set to be the third biggest party, with 7.1 percent of the vote.
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 percent, down from 63 percent 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 mandate.
He told thousands of jubilant supporters in central Athens: "In Europe today, Greece and the Greek people are synonymous with resistance and dignity, and this struggle will be continued together for another four years.
"We have difficulties ahead, but we are also on firm ground. We won't recover from the struggle by magic, but it can happen with hard work."
Mr Tsipras was joined on stage by Panos Kammenos, leader of the the nationalist Independent Greeks, who also entered a coalition with Syriza after the previous election in January.
"Together we will continue the struggle we began seven months ago," Mr Tsipras 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."
The latest projection gives Syriza 145 seats in the 300-seat parliament, with New Democracy on 75. This is only four fewer than Mr Tsipras's thumping victory in January, but again leaves him just short of an absolute majority.
But the Independent Greeks are likely to get 10 seats.