(Adds analysis, quotes)
* Exit poll suggests SNP will win nearly every Scottish seat
* Clean sweep could revive case for independence
By Angus MacSwan and Alistair Smout
EDINBURGH/GLASGOW, May 7 (Reuters) - Scottish nationalists could take nearly every seat in Scotland but be shut out of any role in the British government, according to an exit poll after voting ended in Britain's national election on Thursday.
The poll for national television stations showed the Scottish National Party (SNP) taking 58 out of the 59 parliamentary seats north of the border.
But Prime Minister David Cameron's Conservatives were on course to win the most seats in parliament with 316, just shy of an outright majority, with Ed Miliband's Labor Party trailing on 239.
If confirmed, such an outcome would deny the SNP the kingmaker role it had sought in the House of Commons and kill off the prospect of a leftist alliance with Labor to force Cameron out of office.
But it would dramatically highlight the political divide between England and Scotland, and could bolster Scots to push for a new referendum on independence, having narrowly lost one last year.
Commentator Magnus Linklater said: "You are going to get a bunch of SNP MPs going down to Westminster for whom independence is the ultimate goal, and pressure will build up."
SNP leader Nicola Sturgeon, widely judged to be the star performer of the election campaign even though she was not running for a seat in the London parliament, was wary of the projection.
"I'd treat the exit poll with HUGE caution," she tweeted. "I'm hoping for a good night but I think 58 seats is unlikely!"
The left-of-center SNP had offered during the campaign to work with Labor in order to shut out the Conservatives and reverse austerity policies. Labor leader Miliband had ruled out a coalition, insisting he could win an outright majority.
Labor finance spokesman Ed Balls said: "We have been warning all along that a vote for the SNP risks the Conservatives coming back into power. I fervently hope that is not going to be the case."
The SNP's surge comes just eight months after the independence vote in which Scots narrowly rejected its call to break away from the United Kingdom.
Since then, however, many Scots have become disillusioned with Labor, which has traditionally been strong in Scotland, seeing it as having moved too far away from the left and closer to Conservative thinking. Some in Scotland deride Labor as "Red Tories."
Promises to devolve more power to Scotland have also gone unfulfilled, leading to a sense of betrayal.
Tom Harris, Labor MP for Glasgow South, said he believed many Labor supporters who also backed independence had been disappointed by the party's stand and had switched sides.
Labor is at risk of some embarrassing defeats in Scotland. Casualties could include Douglas Alexander, a party grandee and shadow foreign secretary, who is in danger of losing his seat to a 20-year-old university student, Mhairi Black.
Humza Yousaf, an SNP member of the Scottish parliament for Glasgow, told Reuters: "We're optimistic. It's still early days...but it looks like it'll be a good night for us in Glasgow."
Sturgeon - described by detractors as "the most dangerous woman in Britain" but whom polls show as the most popular politician in the country - has stressed that this election is not, for the SNP, about independence.
"Even if...the SNP wins every seat in Scotland, that is not a mandate for independence or a second referendum," she said on Wednesday.
But her opponents said the SNP's aim was undoubtedly to push for a second referendum. Cameron's Conservatives had described the prospect of Labor and the SNP running Britain as a recipe for chaos and the potential break-up of the UK.
Not all SNP voters are automatically pro-independence, however, and polls show that the sentiment on that issue has not changed much since the referendum.
The SNP would not want to rush into another plebiscite until it was sure of winning it, commentators said.
One factor that could come into play is Cameron's promise to hold a vote by 2017 on whether Britain should leave the European Union, something Sturgeon has said would be against Scotland's wishes.
"Europe will be the trigger," Linklater said. (Editing by Mark Trevelyan)