London, England (CNN) -- British Prime Minister Gordon Brown and his Conservative rival David Cameron both offered to form an alliance with the minority Liberal Democrats Friday as they jostled for power after an election that failed to create an outright winner.
The center-right Conservatives won more seats than Brown's Labour party in Thursday's fiercely-contested vote but lacked the majority needed to form an effective government -- a rare outcome in British politics.
Cameron emphasized areas where his party and the Liberal Democrats agreed, including education reform and scrapping plans for national ID cards, while drawing red lines on defense and the economy.
He was much vaguer on the Liberal Democrats' greatest ambition -- electoral reform -- that would probably give them more seats in parliament.
Cameron said: "The best thing for Britain now is a new government that works together in that national interest," adding that the country needed "a strong, stable government that lasts."
Brown said Friday he would be willing to negotiate with any party leader, but said that Cameron and Liberal leader Nick Clegg were "entitled to take as much time as they feel necessary" to forge a coalition.
"Should the discussions between Mr. Cameron and Mr. Clegg come to nothing then I would of course be prepared to discuss with Mr. Clegg the areas where there may be some measure of agreement between our two parties," he said.
Aware of the uncertainty in the UK financial markets about the outcome of the election and how any future government will tackle the country's budget deficit, both Brown and Cameron pledged to work in the "national interest."
Clegg indicated he would be willing to talk first to the Conservatives. "We're in a fluid political situation, " he said. "It's vital that all political parties, all political leaders act in the national interest and not out of narrow party political advantage."
Official returns Friday showed it would be impossible for any one party to get a majority of seats.
The Conservative party came in first, with at least 306 seats in the 650-seat parliament, followed by Brown's Labour party with at least 258. The Liberal Democrats came third, with at least 57.
About two dozen seats went to smaller parties. One seat will not be decided until May 27, after the election was delayed due to the death of a candidate.
It's very unusual for no party to get an absolute majority of seats in the Commons. The last time it happened, in 1974, voters were back at the polls within months.
Several high-profile incumbents lost their seats overnight, including former Home Secretary Jacqui Smith, of Labour; and Liberal Democrat Lembit Opik, who had been in parliament for 13 years.
All had been implicated in last year's parliamentary expenses scandal.
Northern Ireland First Minister Peter Robinson, who has faced questions over land deals and a scandal involving his wife, also lost his seat. The loss of Robinson, head of the Democratic Unionist party, robs the Conservatives of a potential coalition supporter.
The Green Party, which favors environmental and social justice policies, gained its first member of parliament when Caroline Lucas was elected in Brighton, in southern England.
There were some scenes of voter anger across the country over long lines to cast ballots or polling stations running out of ballot papers, but it was not immediately clear how widespread problems were.
"We will be doing a serious and thorough review of this and making recommendations to parliament and the government," Electoral Commission Chairwoman Jenny Watson said.
The United Kingdom's system of voting is "Victorian, antiquated, left over from an era when less people had to vote" and not designed to cope with mass participation, she said, adding that the system is now "at breaking point."
Liberal Democrat leader Clegg expressed his anger after hundreds of voters were turned away from a polling station in his Sheffield constituency.
Clegg said Friday he was disappointed that an exuberant election campaign buoyed by his stellar performance in the country's first-ever televised prime ministerial debates had failed to deliver hoped-for results.
"Many many people during the election campaign were excited about the prospect of doing something different, but it seems when they came to vote, many of them decided to stick with what they know," he said.
The Liberal Democrats' principal policy aim is reform to the electoral system which is currently weighted in favor of Labour and the Conservatives.
Under the system, the candidate who receives the most votes in a constituency wins. The system, known as "first past the post," is praised for its simplicity and the strong ties it forms between voters and representatives, but critics dislike its failure to provide proportional representation.
CNN's Melissa Gray, Richard Greene and Paul Armstrong in London contributed to this report.