UVALDE, May 24 (Reuters) - A teenage gunman opened fire in a south Texas elementary school on Tuesday (May 24), killing at least 18 children and one adult, before he was also killed, officials said, the latest mass murder as the United States is gripped by an epidemic gun violence.

Governor Greg Abbott said the suspect, identified as 18-year-old Salvador Ramos, was apparently killed by police officers responding to the scene, and that two officers were struck by gunfire, though the governor said their injuries were not serious.

Authorities said the suspect acted alone.

The confusion of the moment saw the accounts of the death toll vary until the state attorney general's office in an official statement put the tally of lives lost at 18 children and two adults, including the shooter. Judging from the grades of the students enrolled at the school, the children ranged in age from seven to 10.

The motive for the massacre was not immediately known.

The carnage unfolded just 10 days after 10 people were killed in Buffalo, New York, in a predominantly Black neighborhood. Authorities have charged an 18-year-old man who they said had traveled hundreds of miles to Buffalo and opened fire with an assault-style rifle at a grocery store.

Official details remained sketchy about the circumstances of the late morning shooting at Robb Elementary School in the town of Uvalde, Texas, about 130km west of San Antonio.

Abbott said the suspect was believed to have abandoned his vehicle and entered the school armed with a handgun, and possibly a rifle, before opening fire.

Texas Public Safety Department Sergeant Erick Estrada, appearing on CNN for an interview, said police saw the suspect emerge from a car he crashed near the school, carrying a rifle and a backpack, and "engaged" with him before he entered the south side of the school and started firing. Estrada said the gunman was wearing body armour.

Investigators believe Ramos shot and killed his grandmother before going to the school, CBS News reported, citing unidentified law enforcement sources.

"It is being reported that the subject shot his grandmother right before he went into the school," Abbott told reporters. "I have no further information about the connection between those two shootings."

University Hospital in San Antonio said on Twitter that it had received two patients from the shooting in Uvalde, a 66-year-old woman and a 10-year-old girl, both listed in critical condition.

US President Joe Biden ordered flags flown at half-staff until sunset daily until May 28 in observance of the tragedy.

He also asked Americans to stand up to the gun lobby and pressure members of Congress to pass sensible gun laws.

The student body at the Texas 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.

Hours after the shooting, police had cordoned off the school with yellow tape. Police cruisers and emergency vehicles were scattered around the perimeter of the school grounds. Uniformed personnel stood in small clusters, some in camouflage carrying semi-automatic weapons.