Four people were killed and two others were injured when a semi-nude gunman opened fire at a Waffle House restaurant near Nashville, Tennessee, early Sunday, police said. The shooter remained at large Sunday afternoon, and authorities warned that he could still be armed.

Travis Reinking, 29, of Morton, Illinois, was being sought Sunday night on criminal homicide charges, police said. They said he was naked except for a green jacket when he got out of his car at about 3:23 a.m. (4:23 a.m. ET) Sunday and shot two people outside the restaurant with an AR-15 rifle, killing them both.

He then went inside the Waffle House and continued firing, killing two more people, police said. The victims were identified as: Taurean C. Sanderlin, 29, of Goodlettsville, an employee of the restaurant; Joe R. Perez, 20, of Nashville; DeEbony Groves, 21, of Gallatin, Tennessee; and Akilah Dasilva, 23, of Antioch, Tennessee; who was critically wounded and died at Vanderbilt University Medical Center.

Police said James Shaw Jr., 29, a restaurant patron, managed to wrestle the firearm from the shooter. "Shaw's actions undoubtedly saved many lives," they said in a statement Sunday night.

Shaw, his hand bandaged, said at the news conference that he made up his mind to confront the gunman and "that if it was going to come down to it, he was going to have to work to kill me."

"That was my opportunity, and I went for it," he later added.

James Shaw Jr. speaks at a news conference in Nashville, Tennessee, on Sunday. Rick Musacchio / EPA

Don Aaron, a spokesman for Metro Nashville police, said federal and state authorities had run across Reinking before.

The Secret Service said Sunday afternoon that Reinking was arrested on July 7 and charged with unlawful entry "after crossing an exterior security barrier near the White House Complex." The Secret Service's Nashville Field Office and headquarters division were working closely with law enforcement involved in the shooting investigation, the statement added.

Reinking crossed a security barrier near some bike racks and refused to leave, Todd Hudson, the special agent in charge of the Nashville field office, said at a news conference Sunday afternoon.

"He wanted to set up a meeting with the president," he added.

After the incident, Illinois revoked Reinking's license to carry firearms and seized four guns — including the AR-15 that was used in the Waffle House shooting — at the request of federal authorities, Aaron said at a news conference later Sunday.

But Illinois authorities then returned those firearms to Reinking's father, who Aaron said admitted giving them back to his son.

The year before, Reinking had been charged with attempted suicide by firearm, law enforcement documents show. The arrest occurred in a CVS parking lot on May 26 after Reinking told a Tazewell County sheriff’s deputy that Taylor Swift was harassing him and had hacked his Netflix account.

When the deputy and a police officer encouraged Reinking to go to a hospital for an evaluation, he refused and drove away, the documents say. Reinking later returned and continued to describe his alleged encounter with the pop star.

When Reinking tried to leave again, the documents say, authorities cited suicidal comments he'd made earlier to his family and a paramedic and placed him in protective custody.

Police said a man believed to be Reinking was last seen in woods near his apartment complex, which is not far from the scene of the shooting. They added that he had put on a pair of pants and was seen wearing black pants and no shirt or jacket.

Nashville police said that one of Reinking’s guns, a pistol, remained unaccounted for.

With the manhunt still underway, the city’s school district said on Sunday night that schools within the search area would follow “lock-out” procedures on Monday, with visitors and guests barred from entrance.

The district added in a statement that those schools had been checked for Reinking and cleared.

Reinking moved to Nashville last fall and worked in the crane and construction trades, Aaron said. He was fired about three weeks ago from one employer and had recently started a job elsewhere. He went to work on Monday and never returned, Aaron said.

Waffle House released a statement Sunday afternoon saying it was "deeply saddened by this tragic incident."

"This is a very sad day for the Waffle House family, and we ask for everyone to keep the victims and their families in their thoughts and prayers," it said.