LONDON (AP) — Counting the votes in Britain's election will take a matter of hours.
Assembling a government is likely to take far longer, even though an exit poll released late Thursday suggested Prime Minister David Cameron's Conservative Party was doing better than expected
The poll predicts Cameron's party will win 316 seats, short of an outright majority, but close to the magic number.
By Friday, the country will know how many seats each party has won in the House of Commons. If either the Conservatives or Labour has more than half the 650 seats, they can quickly form a government — but that doesn't seem likely.
The final opinion polls, and the exit poll, predict a "hung Parliament," in which no party has an absolute majority, triggering a period of wrangling and uncertainty.
WHAT HAPPENS NOW?
If no one has a majority, the parties start talking, to see if formal or informal alliances can help them reach the magic number of seats they need to govern.
In Britain's parliamentary system, the test of a government is whether it can secure the backing of a majority in the House of Commons to pass its budgets and laws.
In theory, that takes 326 seats, but in practice it's about 323: the Speaker does not vote, and Irish nationalists Sinn Fein, who had five seats before the election, do not participate. If the Conservatives are as close as the exit poll suggests, the party would have several avenues open.
There is no rule saying the party with the most seats gets the first shot at talking to other parties about forming a government, but there will be unofficial pressure for that to happen. Liberal Democrat leader Nick Clegg, who served as deputy prime minister in Cameron's first coalition government, says he will speak first to the biggest party, which appears likely to be the Conservatives.
"I've described it like freestyle wrestling," said Peter Riddell of the Institute for Government. "Anyone can talk to anyone else, and it may well be that the second-largest party is in easier position to form a government than the largest party."
As head of state, Queen Elizabeth II formally appoints the prime minister, but her role is symbolic. Once the political picture is clear, current Prime Minister David Cameron will go to Buckingham Palace — either to tell her he can form a government, or to resign and ask her to summon Labour leader Ed Miliband.
If the exit poll result is accurate, Cameron could be expected to muster enough support from other parties to form a government.
HOW LONG WILL IT TAKE?
In 2010, it took five days for the Conservatives and Liberal Democrats to forge a coalition. Gus O'Donnell, who as Britain's top civil servant oversaw those negotiations, said that "was a piece of cake compared to what might happen this time."
"More options, more parties involved ... it is harder this time," he told the BBC.
Parliament is due to reconvene on May 18, when lawmakers will take their oaths and one will be elected Speaker. That could all happen without a government being in place.
A firmer deadline is May 27, the date set for the Queen's Speech. That is an annual address, delivered by the monarch but written by ministers, outlining the government's legislative program. It is followed by a debate and a vote — and it would be hard for a government to survive losing that vote.
IN THE MEANTIME, WHO'S IN CHARGE?
Win or lose, on Friday morning Cameron will remain Britain's prime minister. The current leader and his government will remain in place until a new one is assembled. Ministers are expected to defer major decisions, but handle routine business and emergencies. The national security apparatus remains in place.
Financial markets hate instability, so some fear the pound could take a pummeling if the talks drag on.
"There will be a strong civil service presence saying: 'Do you look at the markets? You had better get a grip. You'd better work something out,'" said Leeds University political scientist David Seawright.
Other analysts believe the markets have already factored in a period of uncertainty so are unlikely to be too volatile.
Riddell points out that protracted negotiations, while novel for Britain, are the norm in many European countries.
He said, "we won't be like Belgium," which went without a government for more than a year.
"The general view is, keep calm and it will work itself out."
WHAT ARE THE LIKELY OUTCOMES?
"It's unbelievable, the permutations," said Seawright. "It'll be musical chairs to see who can form a government."
Some of the potential options:
—The Coalition Continues: Britain could see a continuation of the Conservative-Liberal Democrat coalition that has governed since 2010. The Lib Dems are open to this option, and have campaigned as the sensible center ground between Tories on the right and Labour on the left. But the party is likely to lose a big chunk of its 59 seats. Still, a Conservative-Lib Dem coalition could probably rely for support on key votes from smaller parties including Northern Ireland's Democratic Unionists and the U.K. Independence Party. The exit poll showing suggests this possibility will be high on the list of possible outcomes.
—Minority government: Either Labour or the Conservatives — whichever has more seats — could try to govern alone, relying on smaller parties for support on a vote-by-vote basis. Minority governments are often unstable, and sometimes fall within months. But Britain's political parties, with their members exhausted and coffers depleted, may be unwilling to trigger a second election this year. And recent legal changes have made it harder to bring down a government. Once, defeat on a major piece of legislation would have done it, but it now requires an explicit vote of no-confidence by lawmakers. If the Conservatives are close to a majority, as the exit poll suggests, they could pursue this option.
—Lib-Lab Pact: Labour could try to form a coalition with the Liberal Democrats, who are sympathetic to them on some issues. Such an alliance could probably command support from small left-leaning parties including Wales' Plaid Cymru and the Greens. For this prospect to take hold, Labour would have to perform far better than the exit poll indicates.
—Labour and the SNP: This potential combination is politically fraught. The SNP, which is expected to take most of the seats in Scotland, supports Scottish independence, and its participation in national government has been painted by opponents as a threat to the future of Britain. Labour leader Ed Miliband has ruled out a coalition pact or broad deal with the SNP. But he also knows that the nationalists, who are staunch anti-Conservatives, would back Labour on key votes.
Follow Jill Lawless on Twitter at http://Twitter.com/JillLawless