The head of the Connecticut primary school devastated by a shooting rampage was among the victims, an official said today.

Sandy Hook Elementary School principal Dawn Hochsprung was among the 27 people the gunman shot dead, according to Gerald Stomski, a councillor in nearby Woodbury.

Mr Stomski said Ms Hochsprung was a school principal in Woodbury until a few years ago, adding that she had "an extremely likable style".

She had been head at Sandy Hook Elementary since 2010, and frequently tweeted photos from her job and wrote upbeat tweets about what was going on at the school.

More hauntingly, several publications report she wrote a letter before the school year outlining new safety measures - including locked doors during school hours.

Police said the suspect in the shootings, Adam Lanza, killed his mother at their home before driving her car to the school where he went on the rampage.

Lanza's mother Nancy was a teacher at Sandy Hook, where the 20-year-old killed another 26 people, including 20 children, before shooting himself dead.

State police said 18 children were found dead at the school and two died later in hospital. Six adults were found dead at the scene. They said the shootings occurred in one section of the school but did not give details.

In New Jersey, Lanza's older brother Ryan, 24, of Hoboken, told investigators his brother was believed to suffer from a personality disorder and be "somewhat autistic".

Three guns were found at the scene of the massacre - a Glock and a Sig Sauer, both pistols, and a .223-calibre rifle. The rifle was recovered from the back of a car at the school, and the pistols were found inside the school. Detectives suggested they might have belonged to Ms Lanza.

Hundreds of people attended a church vigil in Connecticut last night to remember the victims of the shooting.

With the St Rose of Lima church in Newtown filled to capacity, hundreds of people stood outside, some holding hands in circles and saying prayers, while others lit candles and sang Silent Night.

State governor Dannel P Malloy was among the speakers at the service.

Investigators are trying to learn as much as possible about Lanza but so far authorities have not spoken publicly of any possible motive. Witnesses said he did not speak during the rampage.

Lanza has been revealed as a high-achieving student who lived in a prosperous neighbourhood with his mother, a well-liked woman who enjoyed hosting dice games and decorating the house for Christmas.

Catherine Urso, who was attending the vigil in Newtown, said her college-age son knew the killer and remembered him for his alternative style.

"He just said he was very thin, very remote and was one of the goths," she said.

Lanza and his mother lived in a well-to-do part of Newtown, a prosperous community of 27,000 people about 60 miles north east of New York City.

Investigators believe he attended Sandy Hook school several years ago but appeared to have no recent connection to the place.

At least one parent said Lanza's mother was a substitute teacher there, but her name did not appear on a staff list. Investigators have so far been unable to establish any connection between her and the school.

Lanza attended Newtown High School, and several local news clippings from recent years mention his name among the school's honour roll students.

Barack Obama wiped tears from his eyes as he told the nation: "Our hearts are broken today."

In an emotional televised address from the White House, he said: "I offer governor Malloy my condolences on behalf of the nation, and made it clear he will have every single resource that he needs to investigate this heinous crime, care for the victims, counsel their families.

"We endured too many of these tragedies in the past few years. And each time I learn the news, I react not as a president, but as anybody else would - as a parent. And that was especially true today. I know there is not a parent in America who doesn't feel the same overwhelming grief that I do.

"The majority of those who died today were children. Beautiful little kids between the ages of five and 10 years old."

The president paused for some seconds and wiped away tears before continuing: "They had their entire lives ahead of them. Birthdays, graduations, weddings, kids of their own. Among the fallen were also teachers, men and women who devoted their lives to helping our children fulfil their dreams.

"So our hearts are broken today. For the parents, and grandparents, sisters and brothers of these little children, and for the families of the adults who were lost.

"Our hearts are broken for the parents of the survivors as well, for, as blessed as they are to have their children home tonight, they know that their children's innocence has been torn away from them too early, and there are no words that will ease their pain."

The Queen and David Cameron led UK tributes. In a message sent to Barack Obama yesterday evening, the Queen said she was "deeply shocked and saddened" to hear of the shootings.

The message, which began "To President Obama", read: "I have been deeply shocked and saddened to learn of the dreadful loss of life today in Newtown, Connecticut; particularly the news that so many of the dead are children.

"Prince Philip joins me in extending our heartfelt sympathy to you and the American people at this difficult time.

"The thoughts and prayers of everyone in the United Kingdom and throughout the Commonwealth are with the families and friends of those killed and with all those who have been affected by today's events."

The message was signed Elizabeth R.

Mr Cameron took to Twitter to say he was "devastated" by the Connecticut shootings and described the death of so many children as "truly heartbreaking".

The Prime Minister later issued a statement, saying: "I was shocked and deeply saddened to hear about today's horrific shooting at Sandy Hook Elementary School in Connecticut that has killed and injured so many innocent people," he said.

"My thoughts are with the injured and those who have lost loved ones.

"It is heartbreaking to think of those who have had their children robbed from them at such a young age, when they had so much life ahead of them.

"I offer my sincere condolences to the families, to president Obama, governor (Dannel) Malloy and the American people. The thoughts of the British people are with you all at this very difficult time."

First Minister Alex Salmond said: "I share the shock and deep sadness of people across the world at the terrible loss of innocent lives at Sandy Hook Elementary School in Connecticut.

"It is impossible to comprehend how the children, along with the adult victims, could have been so cruelly taken from their loved ones.

"All of the victims, the grieving relatives and colleagues, and the entire community of Newtown are in the thoughts and prayers of people across Scotland tonight. I send them my deepest condolences."

Liberal Democrat president Tim Farron tweeted: "The senseless murder of innocent children in Connecticut shocks us all. My thoughts & prayers are with the families affected tonight."

Shock and sympathy were the initial reactions from around the world. Australian prime minister Julia Gillard described the attack as a "senseless and incomprehensible act of evil".

"Like president Obama and his fellow Americans, our hearts too are broken," Ms Gillard said in a statement.

"As parents and grandparents, as brothers and sisters, as friends of the American people, we mourn the loss of children, aged only five to 10 years, whose futures lay before them.

"We mourn the loss of brave teachers who sought only to lead their students into that future but were brutally murdered in a place of refuge and learning."

Australia confronted a similar tragedy in 1996 when a man went on a shooting spree in Tasmania, killing 35 people. The mass killing sparked outrage across the country and led the government to impose strict new gun laws, including a ban on semi-automatic rifles.

In Japan, where guns are severely restricted and there are extremely few gun-related crimes, public broadcaster NHK led the noon news with the shooting, putting it ahead of an update on the final day of campaigning before tomorrow's nationwide parliamentary elections.

NHK, which had a reporter giving a live broadcast from the scene in Connecticut, said five children at the school were Japanese, and that all five were safe.

Several Japanese broadcasters ran footage from Newtown, showing scenes of people singing outside churches as well as part of Mr Obama's tearful press conference.

The attack in Connecticut quickly consumed public discussion in China, rocketing to the top of topic lists on social media and becoming the top story on state television's main noon newscast.

China has seen several rampage attacks at schools in recent years, though the attackers there usually use knives. The most recent attack happened yesterday, when a knife-wielding man injured 22 children and one adult outside a primary school in central China.

Much of the discussion after the Connecticut rampage centred on the easy access to guns in America, unlike in China, where even knives are sometimes banned from sale. But with more than 100,000 Chinese studying in US schools, a sense of shared grief came through.

In the Philippines, a spokeswoman for president Benigno Aquino III said: "What makes it more painful is that most of the victims were small children.

"Our deep condolences go out to the families, teachers and their loved ones. Our hearts and minds are with them and pray with them as they go through a very difficult time, especially with Christmas approaching."