An alliance of liberal parties has emerged ahead of its Islamist rivals in elections to Libya's General National Congress - but both factions are a long way from an overall majority.

Final results show that the National Forces Alliance (NFA), led by US-trained economist Mahmoud Jibril, claimed 39 of the 80 seats allocated to political parties in the 7 July elections - Libya's first democratic ballot in over 40 years.

The Justice and Construction Party (JCP), which represents the Muslim Brotherhood, claimed 17 parliamentary seats, with the remaining party seats going to smaller groups. Alongside the 80 places reserved for political groups, 120 have been allocated to individual candidates.

Reports suggest that both the NFA and JCP have begun to court the smaller parties, and independents, in a bid to form a government capable of securing the two-thirds majorities needed to pass major laws and decisions in Congress.

In addition to providing a government, Congress will be responsible for framing a new constitution for Libya, and guide the country towards sustainable democracy.

The country's key democratic institutions were systematically dismantled by Colonel Muammar Gaddafi, who was executed in October 2011 following a 42-year dictatorship.

Islamist setback

The results appear to represent a setback for the JCP, which was forecast to perform strongly in the elections following the recent victories for Islamist parties in Egypt and Tunisia.

However the party's leader, Mohamed Sawan, greeted the results with magnanimity, saying: "We feel this is a victory for all Libyans...and we congratulate all the winners, independents and political entities."

Sawan continued: "We think we can get between 60 and 70 seats. We are ready to cooperate with any party that is ready to serve the country."

Around 62 percent of Libya's electorate voted in the polls, and it is reported that polling day was largely peaceful, with only minor outbreaks of violence.