According to Texas Governor Greg Abbott, the gunman Salvador Ramos, 18, lived in the area. He was shot dead by police.
Mr Abbott said Ramos abandoned his vehicle and went into the school at 11.30am local time armed with a pistol and possibly a rifle.
“He shot and killed horrifically, incomprehensibly, 14 students and killed a teacher,” he revealed.
The mass shooting took place at Robb Elementary School in the town of Uvalde, about 83 miles from San Antonio, America’s seventh largest city.
A school employee talks through the window of a school bus
/ REUTERSLocal police chief Pete Arredondo said school is attended by children in second, third, and fourth grades, meaning its pupils range between 7 to 10.
Governor Abbott said two officers were also hit during the exchange of gunfire with the shooter but were not seriously injured.
It was not immediately clear how many people, in addition to the dead, were injured.
Earlier, Uvalde Memorial Hospital said 13 children were taken there. Another hospital reported a 66-year-old woman was in critical condition.
A 10-year-old girl is fighting for life at San Antonio’s University Hospital.
Robb Elementary School has an enrollment of just under 600 students.
Tuesday’s shooting is the deadliest in Texas history and occurred four years after a gunman fatally shot 10 people at Santa Fe High School in the Houston area.
A woman reacts outside the civic centre in Uvalde
/ REUTERSA heavy police presence surrounded the school within minutes with officers in heavy vests diverting traffic and FBI agents coming and going from the building.
White House press secretary Karine Jean-Pierre said President Joe Biden has been briefed on the school shooting on Air Force One as he returns from a five-day trip to Asia and would continue to receive updates.
Jean-Pierre said Biden will deliver remarks later in Washington, adding: “His prayers are with the families impacted by this awful event.”
The shooting in Texas came less than two weeks after a gunman opened fire at a supermarket in Buffalo, New York, killing 10 Black shoppers and workers in what officials have described as a hate crime.
Uvalde is home to about 16,000 people and is the seat of government for Uvalde County.
The town is about 75 miles from the border with Mexico. Robb Elementary is in a mostly residential neighborhood of modest homes. There is a funeral home across the street from the school.