Sixth-year pupils at Berwickshire High School, in the Borders, were trying to flog their high school building, facilities and “full use of all staff”.
There were 14 bids made on the listing with the highest reaching £50,000.
Buyers were offered “free collection in person” but warned the seller won’t accept returns.
The listing read: “On behalf of the Berwickshire High School’s Class of 2018, we present the school building, it’s contents and full use of all staff for sale at a bargain price of £2,018.
“The building comprises over 50 rooms, 5 bathrooms, excellent sporting facilities, luxury kitchen and a host of other amenities.
“However what makes this a great buy is the staff on offer.
“This full package deal comes complete with an exclusive angry headmaster, who will probably murder us when he realises we created this listing.
“Unfortunately the school’s value has depleted with the departure of an exceptionally tiny depute; a shame, as we would have enjoyed seeing the shade of purple he would turn in reading this advert.
“Also included are three decorative wall hangings depicting students just trying to go about their daily life (no-one asked for these), a duck pond which we’re sure is radioactive, and a number of other noteworthy teachers who will almost definitely explode after reading this.
“What makes this a unique purchase is the atmosphere of lost hopes and dreams filling the corridors, as pupils live dreaming of the day they can kiss the place goodbye.
“Interested parties in this property can expect full hospitality during their viewing - it’s the least we can do, considering the building is literally sinking into the ground.”
There is a long tradition of sixth year pupils carrying out pranks as they get ready to leave school, often known as “muck up day”.
In 2016, students at the £10,000-a-year George Watson’s College in Edinburgh had their leavers’ ball cancelled after teachers were pelted with eggs, walls were vandalised and toilets blocked.
A haul of booze was seized from high school pupils in Balloch, West Dunbartonshire, as police officers busted their annual ‘muck-up’ day ritual in 2017.
A spokesperson for Scottish Borders Council said: “The listing of Berwickshire High School for sale by auction was carried out by pupils on their last day of school before entering their exam period.
“It was obviously done in a moment of high spirits and that is how it is being received by the school, with pupils keen to see just how much the school they actually hold in high affection could potentially be worth.”
The eBay listing has been removed and it is not known whether an official sale was made.