Mrs Maguire, a mother of two, was stabbed several times around 11.45am. Witnesses said she had been stabbed in the neck and in the back with a kitchen knife. She was taken to hospital but doctors were unable to save her life.
The suspect was restrained by other teachers until police arrived shortly before midday.
'An appalling tragedy'
Mrs Maguire had been married for 37 years to Don Maguire, a 62-year-old landscape gardener, and was mother to two highly successful daughters, Kerry, 32, an osteopath, and Emma, 30, who trained at the Royal Ballet School and has been a Royal Ballet soloist since 2011.
Her death, described as "an appalling tragedy" by Michael Gove, the Education Secretary, reopened the debate over security in schools. Last year 250 children were caught on school premises with weapons.
Mrs Maguire is understood to have been teaching a Spanish class of around 30 pupils when she was attacked.
Jacob Hill, 16, a student at the school, said: "I was told she was stabbed in the back." Jacob, who was in another lesson when he heard screams, said of the accused boy: "He is really clever and always got top grades."
'He was very quiet and a bit of a dweeb'
The boy in custody comes from a middle-class family in the Halton area of Leeds.
Neighbours said that after his parents split some time ago, the boy would rarely speak to anyone outside his immediate family.
He was predicted to get good grades in his GCSEs and excelled particularly in art.
One neighbour said: "He was very quiet and a bit of a dweeb, but never caused any trouble. This is the last thing you would ever have expected from him."
Police were last night piecing together the boy's background, including a Facebook page with a prominent image of the grim reaper.
'She was just lovely'
David Cameron was among those who paid tribute to Mrs Maguire, saying: "My thoughts are with the family of Anne Maguire, as well as the staff and pupils of Corpus Christi school, where she was stabbed to death."
Mrs Maguire, who could have retired last year and was expected to retire this summer, was regarded as a mother figure at Corpus Christi, which she joined in 1974 and where she had been head of Year 11 for more than a decade.
Kerrianne Ayward, 17, said: "She was just lovely. She was helpful and caring and you could have a laugh with her. She was always there for you, even if she didn't know you very well. No one had a bad word for her - I mean no one. She was the heart of the school."
Georgina Kilroy, 16, said her teacher broke down when she told the pupils the news that Mrs Maguire had died. She said that before then they were told a teacher had gone to hospital but lessons continued.
Many pupils burst into tears when they were told that Mrs Maguire had died in hospital. Last night many of them staged a candlelit vigil for the teacher in the Corpus Christi church next to the school.