Bailey, 16, was fatally injured during an incident at Cults Academy in Aberdeen on 28 October.
The private funeral service was held in Maryculter, where Bailey lived.
A 16-year-old boy, who cannot be named for legal reasons, has been remanded in custody after being charged with murder and having a blade or point on school premises.
The mourners included Bailey's family and fellow pupils.
Hundreds of mourners have attended the funeral of Bailey Gwynne, who died after being stabbed at his school.