Hundreds of friends and fellow school pupils have gathered to remember Bailey Gwynne at a special church service.

Candles were lit, tears shed, messages written and memories shared as around 300 people attended the informal vigil for the Cults Academy pupil.

Rev Ewen Gilchrist, of the Church of Scotland Cults Parish, led the service and encouraged people to write a message on boards around the church, or to leave a note of condolence and support for Bailey's family and hang it on a "prayer tree".

Unlike traditional services, tea, coffee and cake was served and chairs were laid out to encourage people to sit and talk in groups.

Current and former pupils, parents, members of the local Cults community and church elders moved around the room adding their messages of support throughout the vigil.

The church was full to capacity with some people sitting on the carpeted floor as all the seats were taken.

Mr Gilchrist said: "We had no idea what to expect tonight.

"We thought something, something must be offered to bring people together.

"Bailey Gwynne's family will hear about this and the number of people here and hopefully it will give them a bit of light in the darkness.

"We don't want to fill the vigil time with words. We don't tell people what to feel or what to think. But we do want to provide a safe and healing place where people can bring their hurt, their bewilderment, their questions, their sadness and even their anger.

"People are free to move around, to light candles, to write on the message boards for Bailey and add a prayer to the prayer tree."

Messages left included "heal the hole in our hearts" and "you will be missed so badly, Bailey".

One message dedicated to the 16-year-old who had talked of his wish to join the Royal Marines, read simply "soldier on soldier."

Addressing those gathered, Mr Gilchrist said: "How can people be so alive and then not be alive? How can people who so easily fill their space and place like Bailey suddenly be a terrible absence?

"Bailey went to school yesterday and would never come home. Some time soon, some days from now, Bailey's parents will have to bury their son.

"It's not meant to be like that, we know it's not meant to be like that.

"Sometimes life seems so unfair and sometimes life can be so uncertain and fragile and so easily and suddenly lost."

Mr Gilchrist, dressed in a shirt, tie and tweed jacket rather than religious clothing, lit a candle on the altar and invited young people up to do the same.

He told the gathering: "Please talk to one another, help each other, and if you can light a candle."

A piano was played in the background as people moved around the church.

Minister Paul Watson of St Devenick's Episcopal Church led a short period of prayers.

He told Bailey's year group not to be defined by grief but to come together to help each other and be known as the "closest year group ever".

Cults Academy chaplain John Ferguson, whose two sons went to the school, read a poem about love.

He ended by saying: "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."

Mr Gilchrist brought the service to a close after an hour and a half.

He thanked people for their attendance and said the parish door will remain open for anyone who wants to talk or spend time alone in the church.

He said: "We're at the end of our vigil but we're not at the end of our sense of loss."

Earlier, the family of Bailey, who was fatally stabbed at an Aberdeen secondary school, paid tribute to their "beloved boy" who "never failed to make us smile".

The 16-year-old suffered serious injuries in an incident at Cults Academy, in the west of the city, at about 1.30pm on Wednesday and died a short time later in hospital.

A 16-year-old boy has been charged in connection with the death. He is expected to appear at the city's sheriff court on Friday.

In a statement released through Police Scotland, Bailey's family said: "There are no words.

"Bailey is our beloved boy and our heart. Our hearts have gone with him.

"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."

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

Police Scotland Chief Superintendent Adrian Watson said evidence suggests it was a ''contained incident'' at the school with no-one else being sought.

He told a press conference in Aberdeen: ''In nigh-on 30 years in the police service as a senior investigating officer and for the past six years as commander for Aberdeen, you think that you have seen it all until you learn of yesterday's tragic events.''

Sending his condolences to the schoolboy's family and friends, he added: ''I know full well this will be deeply felt not only in the Cults area but across Aberdeen, and of course further afield.''

The officer went on: ''I can confirm we have charged a 16-year-old male in connection with the incident and he will be appearing at Aberdeen Sheriff Court tomorrow.

''I need to stress that all the evidence gathered to date suggests that this is a contained incident and we are not looking for anyone else.''

He added: "I can't go into the detail but we had several people who witnessed it in part, there's a lot of evidence still to work through and gather as you can imagine."

Dozens of floral tributes have been left at the school gates.

Counselling is being made available to pupils and staff at the school, which has been closed for the rest of the week, and a dedicated phoneline has been set up for those affected on 01224 264299.

It was also confirmed there will be a series of assemblies held on Monday for pupils.