Sri Lanka's Prime Minister Ranil Wickremesinghe (5th L)

Sri Lanka's ruling party won parliamentary elections on Tuesday, making huge gains and strengthening its mandate for reform, although it has fallen short of an outright majority, official results showed.

Voters swung behind Prime Minister Ranil Wickremesinghe's United National Party (UNP), dashing ex-strongman Mahinda Rajapakse's hopes of a comeback after his shock defeat in January's presidential poll.

The UNP more than doubled its numbers in the 225-parliament from 40 to 106 at the general election held on Monday, just short of a majority of at least 113.

The prime minister is now expected to form the next government, although his party will need to rely on allies to pass bills including democratic reforms promised at the presidential poll in January.

Rajapakse's United People's Freedom Alliance (UPFA) won 95 seats, losing strength in the parliament and with no obvious allies to form a coalition government.

Before official results were released, Rajapakse told AFP that he was conceding, after his "dream of becoming prime minister faded away". He said he would instead become an opposition lawmaker after winning his individual seat.

The minority Tamil National Alliance (TNA) emerged as the third largest party with 16 seats, while the Marxist JVP, or the People's Liberation Front, won six.

Both parties have said they will not join a coalition government and will instead vote on legislation on a case by case basis.

Two other smaller parties got one seat each.

President Maithripala Sirisena, who defeated Rajapakse in January, called the election one year ahead of schedule to strengthen his mandate for reform and appointed Wickremesinghe as prime minister.

Tuesday's results were a throw back to the parliament of 1994 when then president Chandrika Kumaratunga, with 105 seats, established a government that ran its full six-year term with the help of minority allies.