Portugal's incumbent Prime Minister Antonio Costa's Socialists have taken the lead in a general election, exit polls have shown, after presiding over a period of solid economic growth following years of austerity.

The Socialists, which governed for the past four years with the support of two smaller hard-left parties, have won between 100 to 117 seats in Portugal's 230-seat parliament, according to the polls for public television RTP and private stations SIC and TVI.

Despite their victory, the Socialists appear to have fallen just shy of an outright majority.

To have an absolute majority a party would need at least 116 seats.

Earlier opinion polls indicated the Socialists would come top with between 36.5% and 38.8% of the vote, but would need one or more parties to back them to stay in government.

Mr Costa's minority government has been backed by two far-left parties since 2015.

"The main question is whether we'll have our hands tied," Mr Costa said during a campaign rally on Friday.

"We need to have the strength to guarantee four years of stability and not be a short-term government."

Mr Costa's government has been praised by Brussels and at home for combining fiscal discipline with measures to promote growth after recession and the austerity of Portugal's 2010-14 debt crisis.

The centre-right Social Democrats (PSD), the main opposition party, was polling at under 30% and was expected to lose seats, while the Socialists are seen winning more than in 2015.

Post-election negotiations are not expected to be as messy as in neighbouring Spain, which still has no government more than five months after elections and is heading for a repeat poll in November.

In 2015 it took less than two months for Mr Costa, whose party had actually come second, behind the PSD, to strike an unexpected alliance with two far-left, Eurosceptic parties, the Left Bloc and the Communists and be sworn in as prime minister.

Four years on, the hard left is demanding more public spending and has accused Mr Costa of veering to the right.

Mr Costa has already ruled out a formal coalition but may try to renew his governing pact with one of the parties or both.

Since the last election, the People-Animals-Nature party (PAN) has grown in popularity and could become a kingmaker in parliament.

PAN has said it is ready to support Mr Costa if he commits to its environmentalist proposals, but it remains to be seen whether the party will win enough new seats.

Voting began at 8am and closes at 7pm. Exit polls are expected an hour later and official results will trickle in through the evening.

Depending on how close the outcome is, a clear picture could emerge quickly or take days or even weeks.

Portugal is expected to record its lowest budget deficit in 45 years of democratic history this year.

The economy is on course to grow 1.9% in 2019, above the EU average, helped by export growth and a booming tourism industry.