The "nation" of Kelso High School has voted to remain independent.
Pupils voted at the end of three weeks of "independence"
Last month the Scottish Borders school declared "independence" as its own way of studying the 300th anniversary of the Act of Union.
After a trial three-week period it held a referendum to decide whether or not to rejoin the United Kingdom.
The vote - which was monitored by John Curtice, Professor in Politics at Strathclyde University - was almost four to one in favour of independence.
During the trial period pupils created their own flag, currency and constitution.
The referendum attracted a strong turnout of the 651 pupils.
They voted by 437 to 113 in favour of remaining an independent nation state.
The result followed the shock find earlier this week of gas supplies in the Republic of Kelso High.
Workmen in the multi-use games area uncovered an old sealed-off pipe, which still had gas inside.
Rector Charlie Robertson said the discovery had not swayed the vote.
"The gas find doesn't quite put us in the superpower league, but we now view ourselves as an energy rich state," he said.
"This may help bring in a few Bawbees, which isn't just a turn of phrase, but is our national currency.
"It wasn't a major factor in the presentations being put forward by those advocating the school stays an independent nation."
Professor Curtice, who kept a close eye on proceedings, said the result was something of a surprise.
"This clearly is a stupendous result for the pro-independence campaigners," he said.
"A four to one majority in this election wasn't what the opinion polls had been predicting.
"Evidently there was a dramatic swing in favour of independence in the final hours of the vote."
The school's experiment will be the focus of Passport to Kelso - a programme to be presented by Iain Macwhirter on BBC Radio Scotland on 25 March.
Kelso High is also currently involved in the SoundTown project, which sees the installation of a fully-functioning BBC radio studio in the school.