The suspect in a quadruple homicide at a US restaurant has been taken into custody, police said.

Authorities had mounted a massive manhunt for 29-year-old Travis Reinking, after the Sunday morning shooting at a Waffle House in Nashville.

More than 100 police officers had been going door-to-door and searching wooded areas, joined by dozens of agents with the FBI, the Bureau of Alcohol, Tobacco, Firearms and Explosives and officers with the Tennessee Highway Patrol.

Police said he had stolen a BMW days before the attack. The car was quickly recovered, but authorities did not immediately link it to Reinking.

Reinking, described as a white man with brown hair, opened fire with an AR-15 in the Waffle House car park and then stormed the restaurant shortly after 3am on Sunday, police say.

Four people were killed and four injured before a quick-thinking customer wrestled the assault weapon away, preventing more bloodshed. Reinking then disappeared, police said.

Police said about 20 people were in the Waffle House at the time of the shootings. They included people of different races and ethnicities, but the four people killed were minorities – three black and one Hispanic.

It is not clear why Reinking opened fire on restaurant patrons, though he may have “mental issues”, Metropolitan Nashville Police Chief Steve Anderson said earlier.

He was considered armed and dangerous because he was known to have owned a handgun authorities have not recovered.

Authorities in Illinois shared past reports suggesting multiple red flags about a disturbed young man with paranoid delusions.

In May 2016, Reinking told deputies from Tazewell County that music superstar Taylor Swift was stalking him and hacking his phone, and that his family was also involved, according to a report.

He agreed to go to a local hospital for an evaluation after repeatedly resisting the request, the sheriff’s report said.

Another sheriff’s report said Reinking barged into a community pool in Tremont, Illinois, last June, and jumped into the water wearing a pink woman’s coat over his underwear.

Investigators believed he had an AR-15 rifle in his car boot, but it was never displayed. No charges were filed.

Last July, Reinking was arrested by the Secret Service after he crossed into a restricted area near the White House and refused to leave, saying he wanted to meet President Donald Trump.

Reinking was not armed at the time, but at the FBI’s request, state police in Illinois revoked his state firearms card and seized four guns from him, authorities said.

The AR-15 used in the shootings was among the firearms seized.

Then, in August, Reinking told police he wanted to file a report about 20 to 30 people tapping into his computer and phone and people “barking like dogs” outside his residence, according to a report.

“There’s certainly evidence that there’s some sort of mental health issues involved,” Tazewell County Sheriff Robert Huston said.

But he said officers returned the guns to Reinking’s father on the promise that he would “keep the weapons secure and out of the possession of Travis”.

Reinking’s father “has now acknowledged giving them back” to his son, Mr Aaron said.

Police say Reinking drove into the Waffle House car park early on Sunday and sat there for about four minutes before opening fire outside the restaurant.

The victims who were fatally shot outside the restaurant have been identified as Taurean Sanderlin, 29, of Goodlettsville, and Joe Perez, 20, of Nashville.

Mr Sanderlin was an employee at the restaurant.

Mr Perez’s mother posted a picture of her son on Facebook and asked for prayers, saying it was the hardest day of her life. “Me, my husband and sons are broken right now with this loss,” Trisha Perez said. “Our lives are shattered.”

Reinking then went inside the restaurant and opened fire, police said.

One of the fatally wounded inside was DeEbony Groves, a 21-year student at Nashville’s Belmont University. She was remembered as an exceptional student and a tenacious basketball player.

Akilah Dasilva was also killed inside the restaurant. The 23-year-old from Antioch was a rap artist and music video producer who had such skills behind the camera that he was a favourite among many of Music City’s independent musicians and recording labels, The Tennessean reported.