A 16-year-old boy has appeared in court charged with murdering Bailey Gwynne, who was stabbed at an Aberdeen secondary school.

Bailey, 16, was taken to hospital with serious injuries after the incident at Cults Academy at about 1.30pm on Wednesday, but he died a short time later.

The accused, who cannot be named for legal reasons, appeared in private at Aberdeen Sheriff Court on Friday afternoon.

The 16-year-old, from Aberdeen, was charged with murder when he appeared on petition before a sheriff.

The accused made no plea or declaration and was remanded in custody, the Crown Office confirmed.

The case was committed for further examination and the teenager is expected to return to court on November 6.

The teenager also faces charges under the section of the Criminal Law (Consolidation) Act which makes it an offence to have an article with a blade or point on school premises.

Bailey's family have paid tribute to their "beloved boy" and said there were no words to describe their loss.

"Our hearts have gone with him,'' they said in a statement.

"A special son, brother, grandson and friend - he never failed to make us smile (most of the time). He will always be our boy.

"We don't know what we will do without our junior 'man about the house'. We need time now to look after each other and send our love to all those who care for Bailey."

Hundreds of the fifth-year pupil's friends and fellow pupils attended a vigil at Cults Parish Church on Thursday night, where candles were lit and messages of condolence written.

Rev Ewen Gilchrist said he hoped the number attending would offer Bailey's family "a bit of light in the darkness".

Cults Academy chaplain John Ferguson said: "My hope is that the love in this community will help Bailey's family and get us all through the coming days.

"Bailey in his life knew love and for that we can all be thankful."

The comprehensive school, which has more than 1,000 pupils, is in an affluent suburb of Aberdeen and serves the lower Deeside area.

Head teacher Anna Muirhead has described Bailey as "gentle and caring", and told of the shock within the community following his death.

Aberdeen City Council chief executive Angela Scott said there had been "individual acts of heroism" at the school.

Council leader Jenny Laing told a press conference in the city on Thursday: "When you send your children to school you expect them to be in a place of safety and in a place where they will be equipped for their life ahead. That opportunity has been denied to Bailey."

She said the loss of life "represents a unique set of circumstances and is extremely rare, if not unheard of, in our city and its schools".

Hundreds of floral tributes and messages have been left at the school gates.

Counselling is being made available to pupils and staff at the school, which is closed until Monday. A special phone line has also been set up for those affected on 01224 264299.

The council said hundreds of letters and emails of support have been received from around the world for staff and pupils at the school.

Ms Laing said: "The amount of support for the school family, and the wider community, has been overwhelming and will no doubt help in the weeks ahead.

"We have in place a series of measures to help pupils, families and our staff during what has been a difficult time.

"The pupils will be welcomed back to school on Monday so we can provide support, and also so we can start the process of helping them back into their studies."

Flowers laid outside the gates have been moved to the school's private courtyard garden so students can view them and pay their respects on Monday.