The death toll in the latest US school shooting rose to four today after a 17-year-old student died from his wounds in the attack at a Michigan high school, local police said.

The Oakland County Sheriff's office said in a statement that Justin Shilling, who was a student at Oxford High School in the rural town of Oxford, Michigan, succumbed to his wounds in the attack.

Police yesterday said that a 15-year-old student opened fire with a semi-automatic handgun in the high school, shooting at least 30 rounds that have now left four students dead and six students and one teacher wounded.

There was no immediate explanation for the attack, which sent panic through the 1,800 students at the school, according to police.

The alleged shooter used a nine millimeter Sig Sauer pistol that his father bought for him on 26 November, the day after Thanksgiving known as "Black Friday" for massive sales put on by stores nationwide to launch the Christmas gift-shopping period, the police said.

The suspect, a second-year student, apparently brought the gun into school with a backpack and multiple ammunition magazines.

He surrendered to police in the hallway of the school, with several rounds still in the gun, they said.

Police said that on the night before the attack at Oxford High School in Michigan the suspect recorded a video on his cell phone saying he was planning to launch an attack at the school the next day.

The video was not posted online and there was no advance warning, according to Oakland County Sheriff Michael Bouchard.

Police said they had searched the home of the suspect. "This is expected to be a lengthy investigation and hundreds of interviews will be conducted," they said in a statement.

"There was no resistance during the arrest and the suspect has asked for a lawyer and has not made any statements as to a motive," the sheriff's office said.

"It's a very tragic situation," Undersheriff Michael McCabe told reporters.

Mr McCabe said police received more than 100 emergency calls shortly after noon local time yesterday, and that the shooter unleashed 15-20 shots over about five minutes.

The suspect was taken into custody within five minutes of the first 911 call, he said.

President Joe Biden was informed of the shooting during a visit to Minnesota.

"My heart goes out to the families enduring the unimaginable grief of losing a loved one," he said.

"That whole community has to be just in a state of shock right now."

Mr McCabe said police had been in contact with the suspect's parents and had searched their home.

The suspect had been in class and appeared to carry out the attack alone and it was unclear if the victims had been specifically targeted or were randomly shot, Mr McCabe said.

"I think this is every parent's worst nightmare," Michigan Governor Gretchen Whitmer said at the same press briefing.

Students and parents attend a vigil for the victims

It was the deadliest school shooting in the US so far this year, according to Everytown For Gun Safety, a group which keeps statistics of mass shootings and lobbies for gun control.

Before yesterday's incident, there had been 138 shootings in schools across the United States in 2021, according to figures provided by Everytown.

In those incidents, 26 resulted in fatalities, though no more than two each time.

The deadliest school shootings in US history were the April 2007 attack at Virginia Tech in Blacksburg, Virginia, which saw 33 killed, including the shooter.

In December 2012, an attack on the Sandy Hook primary school in Newtown, Connecticut left 28 dead, including 20 children and the shooter.

In February 2018, a man with an AR-15 assault rifle opened fire in his former high school in Parkland, Florida, killing 17, in the deadliest shooting at a secondary school.