A nearly naked gunman wearing only a green jacket and brandishing an assault rifle stormed a Waffle House restaurant in Nashville early on Sunday, shooting four people to death before a customer rushed him and wrestled the weapon away.

Authorities were searching for the 29-year-old suspect, Travis Reinking, who they said drove to the busy restaurant and killed two people in the parking lot before entering and continuing to fire. When his AR-15 rifle either jammed or the clip was empty, the customer disarmed him in a scuffle.

Four people were also wounded before the gunman fled, throwing off his jacket.

Nashville Police Chief Steve Anderson there was no clear motive, but the suspect may still be armed, because he was known to have owned a handgun that authorities have not recovered.

US Secret Service agents arrested Reinking last July for being in a restricted area near the White House, officials said. Special Agent Todd Hudson said Reinking was detained after refusing to leave the restricted area, saying he wanted to meet President Donald Trump.

At least four people died after a gunman opened fire at the restaurant in Nashville (Mark Humphrey/AP)
At least four people died after a gunman opened fire at the restaurant in Nashville (Mark Humphrey/AP)

State police in Illinois, where Reinking lived until last fall, subsequently revoked his state firearms card at the request of the FBI and four guns were then taken from him, including the AR-15 used in Sunday’s shooting as well as a handgun, authorities said.

Sheriff Robert Huston in Tazewell County, Illinois, said deputies allowed Reinking’s father to take possession of the guns on the promise that he would “keep the weapons secure and out of the possession of Travis”.

Mr Huston added that, based on past deputies’ encounters with Reinking, “there’s certainly evidence that there’s some sort of mental health issues involved”.

While Mr Huston said it was unclear how Reinking reclaimed the guns, Nashville Police spokesman Don Aaron said that his father “has now acknowledged giving them back to his son”.

Phone calls to a number listed for the father, Jeffrey Reinking, went unanswered.

Meanwhile, authorities hailed the customer who intervened to stop a further bloodbath, 29-year-old James Shaw, Jr, as a hero — though the father of a four-year-old girl demurred and said he was just trying to survive.

With one hand bandaged, Mr Shaw told reporters he first thought the gunshots fired around 3.25am were plates falling from a dishwashing station.

When he realised what was happening, he took cover behind a door as shots shattered windows. The gun either jammed or needed a new clip, and that’s when Mr Shaw said he pounced after making up his mind that “he was going to have to work to kill me”.

Mr Shaw said he was not a religious man, but “for a tenth of a second, something was with me to run through that door and get the gun from him”.

They cursed at each other as they scuffled, Mr Shaw said, and he was able to grab the gun and toss it over a counter. The gunman then ran away into the dark of Antioch neighbourhood of south-east Nashville.

Authorities said he shed his jacket nearby and police found two AR-15 magazines loaded with bullets in the pockets. He was seen walking, naked, on a road, officials said, but later was spotted wearing pants but no shirt after apparently returning to his apartment.

Another witness, Chuck Cordero, told The Tennessean newspaper he had stopped to get a cup of coffee and was outside the Waffle House when the chaos unfolded.

“He did not say anything,” Mr Cordero said of the gunman, who he described as “all business”.

Mr Cordero said Mr Shaw saved lives. “There was plenty more people in that restaurant,” he said.

The dead were identified as 29-year-old restaurant worker Taurean C Sanderlin and restaurant patron Joe R Perez, 20, who were killed outside the restaurant; Akilah Dasilva, 23, who was critically wounded inside and later died at Vanderbilt University Medical Centre; and Deebony Groves, 21, who was fatally shot inside.

Mr Aaron, the police spokesman, said two of the wounded were being treated for gunshot wounds at the medical centre, where spokeswoman Jennifer Wetzel said one was in critical condition and the other was in critical but stable condition.

Mr Aaron said Reinking had been employed in construction and lived near the restaurant, and police used yellow crime scene tape to block public access to an apartment complex about a half-mile from the Waffle House. Reinking is originally from Morton, Illinois.

“This is a very sad day for the Waffle House family,” the company said in a statement on Twitter. “We ask for everyone to keep the victims and their families in their thoughts and prayers.”

Nashville mayor David Briley described the shooting as “a tragic day” for the city.

“My heart goes out to the families & friends of every person who was killed or wounded,” Mr Briley said in an emailed statement. “I know all of their lives will be forever changed by this devastating crime.”