A man suspected of killing four people at a Waffle House in Tennessee has been arrested by police in Nashville.
Police said Travis Reinking, 29, was caught in a wooded area. He allegedly opened fire at the restaurant on Sunday with an AR-15 rifle, before discarding his coat and fleeing naked.
A customer, James Shaw Jr, prevented further bloodshed by wresting the rifle out of the suspect's hands.
Police photos showed Mr Reinking with a ripped shirt and scratches on his body.
He was found with a handgun and ammunition in his backpack when he was detained, police said. He requested a lawyer and refused to answer questions.
Investigators have not established any motive for the shooting. "We don't know why he went into the Waffle House," spokesman Don Aaron told reporters.
About 160 law enforcement officials were involved in the search for the Mr Reinking, who was added to the list of the top ten most-wanted fugitives in the state.
Nashville mayor David Briley said a tip from a member of the community led to Mr Reinking's arrest. Local police were supported in their search for the suspect by the Federal Bureau Investigation (FBI); Bureau of Alcohol, Tobacco and Firearms (ATF); and Swat officers.
Mr Reinking was already known to the authorities after various encounters over the past two years. Police reports show he had suffered delusions that people, including singer Taylor Swift, were following him.
Last year he was arrested after entering a restricted area near the White House. He surrendered his firearms to the police at the time, but they were passed to his father for safekeeping, and made their way back into his hands.
A spokesman for the ATF said Mr Reinking's father, Jeffrey Reinking, may have violated guns laws if he knowingly passed the weapons back to his son, who was prohibited from possessing a firearm.
Mr Reinking is also suspected of stealing a car from a dealership in Brentwood, Tennessee. Police officers found keys to the stolen vehicle on Sunday while searching his apartment after the shooting. Charges in that case are still pending, police say.
The gunman arrived at the Waffle House on Sunday in a pickup truck. He shot two people outside the restaurant and two more inside.
The dead were Akilah Dasilva, 23; DeEbony Groves, 21; Joe Perez, 20; and Taurean Sanderlin, 29. Four more people were wounded before Mr Shaw Jr intervened.
Police released a photo of the rifle lying on the restaurant floor after the shooting. It appeared to be an AR-15 semi-automatic, a controversial weapon commonly used by mass shooters in the US.
At a press conference on Sunday, Mr Shaw Jr said he had heard gunshots and glass smashing as people ran for cover. He then hid in the restaurant's toilet area but the gunman shot through the door, injuring his arm.
"It was at that time that I kind of made up my mind - because there's no way to lock that door - that if it was going to come down to it he was gonna have to work to kill me," he said.
When the firing stopped and the gunman was looking at his weapon, Mr Shaw rushed towards him and a scuffle ensued.
"I hit him with the door and the gun was kind of jammed up," he said. "I grabbed it from him and I threw it over the countertop."