Singapore's ruling People's Action Party (PAP) has been defeated for the second time in eight months in by-elections, signalling widening discontent over immigration policies and rising income inequality.

Saturday's defeat gives the opposition Workers' Party another seat in parliament - candidate Lee Li Lian won 54.5 percent of almost 29,800 votes cast in the Punggol East district, faring better than three other candidates including the PAP's Koh Poh Koon, who received 43.7 percent.

The Workers' Party now has seven seats in parliament and the PAP has 80.

"Despite this victory, the Workers' Party is still a small party with much to do and improve upon," said party chairwoman Sylvia Lim.

The PAP, which has ruled the country since 1959, has seen its support decline in recent years due to rising discontent over the high cost of living, an influx of foreigners and rising income inequality.

It won only 60 percent of the votes in the 2011 general election.

Prime Minister Lee Hsien Loong said that the PAP "will continue to work to improve the lives of Singaporeans, and present our report card for voters to judge in the next general elections".

Analysts say PAP's defeat forces the party to re-examine policies that have brought about popular discontent in the city-state.

"This is a shock for the PAP," said Bridget Welsh, an associate professor of political science at the Singapore Management University.

"They went to the polls so quickly with confidence and had expected to win. It forces the PAP to have a very serious evaluation of their policies, and what they've done wrong."

Andrew Loh, a political blogger, said the PAP's loss "is a reflection of the uncertainty that Singaporeans have about their future. They also want stronger voices in parliament."