An 18-year-old gunman shot dead 19 children and two adults at a Texas primary school, the US state's governor said.

Speaking from the White House, US President, Joe Biden, said it was time for Americans to "stand up" to the country's gun lobby.

"It's time to act. We can do so much more," Mr Biden said.

The assailant "shot and killed, horrifically and incomprehensibly, 14 students and killed a teacher," Governor Greg Abbott told a news conference.

He said the shooting suspect, a local teenager, was also "deceased," adding that "it is believed that responding officers killed him." Police said that the suspect acted alone.

The attack happened at Robb Elementary School in the town of Uvalde, Texas, about 100km west of San Antonio. The small community is also about an hour from the Mexican border.

A police press conference said the victims came from grades two, three and four. Children in these classes are typically aged between six and nine years old.

Official details on the circumstances of the midday shooting (local time) remained sketchy in the immediate aftermath of the violence.

Robb elementary school in Uvalde, Texas

"He shot and killed horrifically, incomprehensibly, 14 students and killed a teacher," Mr Abbott told a news briefing.

Mr Abbott said the gunman was believed to have "abandoned his vehicle and entered into the Robb Elementary School in Uvalde with a handgun, and he may also have had a rifle".

He shared a post on Twitter saying that Texans were grieving for the victims of "this senseless crime".

The student body at the school consists of children in the second, third and fourth grades, according to Pete Arredondo, chief of the Uvalde Consolidated Independent School District Police Department, who also addressed reporters.

Uvalde Memorial Hospital said on Facebook that 13 children had been transferred there for treatment. It said two were deceased on arrival.

University Hospital in San Antonio said on Twitter it had received two patients from the shooting, one child and one adult.

Both patients, a 66-year-old woman and a 10-year-old girl, were listed in critical condition.

Mr Biden spoke by phone with Mr Abbott, and the White House Communications Director said that the US President offered any assistance needed following the shooting.

The White House ordered flags to be flown at half-staff in mourning for the victims - whose deaths sent a wave of shock through a country still scarred by the horror of Sandy Hook.

Ted Cruz, a Republican US senator from Texas, tweeted that he and his wife are "lifting up in prayer the children and families in the horrific shooting in Uvalde.

"Thank you to heroic law enforcement & first responders for acting so swiftly," he added.

The shooting is the deadliest such incident in the US since 14 high school students and three adult staff were killed in Parkland, Florida in 2018.

It is the worst at an elementary (primary) school since the 2012 Sandy Hook shooting in Connecticut, in which 20 children and six staff were killed.

Despite recurring mass-casualty shootings and a nationwide wave of gun violence, multiple initiatives to reform gun regulations have failed in the US Congress, leaving states and local councils to enact their own restrictions.

The National Rifle Association has been instrumental in fighting against stricter US gun laws. Mr Abbott and Mr Cruz are listed as speakers at a forum that is being held by the powerful lobby in Houston, Texas later this week.

The United States suffered 19,350 firearm homicides in 2020, up nearly 35% compared to 2019, the Centers for Disease Control and Prevention said in its latest data.