Investigators yesterday arrested a second person as a material witness in the attacks on the World Trade Center and the Pentagon, and have detained 25 people on immigration violations for questioning, the Justice Department said.

A Justice Department official gave no details on the second arrest. On Friday, authorities arrested a man they were already holding on suspicion of having a false pilot's license.

Justice Department spokeswoman Mindy Tucker said that none of the 25 detainees had been charged with a crime and that several were cooperating. Department sources said two of the 25 were stopped at an Amtrak station in Fort Worth with $5,000 in cash and a box cutter, the same kind of knife used by the 19 hijackers who crashed four planes last Tuesday.

As the investigation gathered strength yesterday, unusual leads began to surface, among them the possibility that some of the hijackers may have received training at Pensacola Naval Air Station in Florida or other U.S. military facilities.

Two of 19 suspects named by the FBI, Saeed Alghamdi and Ahmed Alghamdi, have the same names as men listed at a housing facility for foreign military trainees at Pensacola. Two others, Hamza Alghamdi and Ahmed Alnami, have names similar to individuals listed in public records as using the same address inside the base.

In addition, a man named Saeed Alghamdi graduated from the Defense Language Institute at Lackland Air Force Base in San Antonio, while men with the same names as two other hijackers, Mohamed Atta and Abdulaziz Alomari, appear as graduates of the U.S. International Officers School at Maxwell Air Force Base, Ala., and the Aerospace Medical School at Brooks Air Force Base in San Antonio, respectively.

"Some of the FBI suspects had names similar to those used by foreign alumni of U.S. military courses," the Air Force acknowledged in a statement. "However, discrepancies in their biographical data, such as birth dates 20 years off, indicate we are probably not talking about the same people."

Still, investigators built solid evidence on other suspects. In Germany, authorities linked a third hijacker to an alleged Islamic terrorist cell that operated in the northern city of Hamburg for years, and they seized "airplane-related documents" from his girlfriend's apartment.

German authorities said that Ziad Jarrahi, 27, who was aboard the hijacked plane that crashed in Pennsylvania, had lived for the past four years in Hamburg, sharing an apartment with Atta and Marwan Al-Shehhi, another suspect. Jarrahi studied aircraft construction.

U.S. officials also confirmed yesterday that Khalid Al-Midhar, identified as one of the hijackers aboard the flight that crashed into the Pentagon, was spotted on a surveillance videotape from Kuala Lumpur, Malaysia, speaking with a suspect in last year's bombing of the destroyer USS Cole in the Yemeni port of Aden. The tape is another piece of circumstantial evidence linking the Sept. 11 attacks to exiled Saudi militant Osama bin Laden, who is suspected of masterminding the Cole bombing.

In India, Saudi diplomat Ahmed Alshehri, based in Bombay, denied that he was the father of hijacker Waleed M. Alshehri or that he had ever served in the United States. Diplomatic lists, however, show an Ahmed Alshehri as second secretary at the Saudi Embassy in Washington, and property records, law enforcement sources and witnesses have linked him with Waleed. Reports from a Saudi newspaper editor said yesterday that both Waleed and Wail Alshehri, another hijacker, were Ahmed's sons.

After the Justice Department released the names of the hijackers Friday, ordinary people began to realize, to their surprise, that they had encountered the suspects in their final days and hours.

At the Panther Motel, in Deerfield Beach, Fla., Richard Surma and his wife, Diane, remembered that hijacker Marwan Al-Shehhi and a man whose name they did not know had been their guests between Aug. 26 and Sept. 9.

The pair spent their time at the motel's small pool and had numerous visits from a third man. When Al-Shehhi checked out, his trash included flight training textbooks, a stack of air traffic maps, martial arts manuals and a box-cutting knife, the motel owners said.

"They were very neat and very polite," Richard Surma recalled. But he and his wife thought it was curious that the men had used a towel to cover a picture hanging in their room of a woman wearing a dress that exposed one shoulder.

In Fort Lee, N.J., Dave Hascup, manager of a Mail Boxes Etc. store in the Linwood Plaza Mall, said FBI and police officers interviewed him Wednesday about hijackers Nawaq Alhamzi and Salem Alhamzi, whom authorities said had a mailbox there.

"I sat in the back while [the FBI agents] checked the mailbox," Hascup said. "There are just some things you don't want to know."

Elsewhere, it was the incongruities that caught the attention of investigators. In Weehauken, N.J., authorities said teams of FBI agents searched a warehouse owned by Urban Moving Systems after neighbors spotted several employees jumping up and down in celebration soon after the World Trade Center attacks.

In Union City, N.J., FBI agents went door to door late Tuesday night and early Wednesday evening at the Doric, a high-rise apartment building, interviewing tenants and showing them photos of about a half dozen men who appeared to be in their late twenties or early thirties and of Middle Eastern descent.

The agents arrived after a Doric resident saw five men in the area of the apartment building, which had a good view of the World Trade Center, either taking photos or videotaping scenes from across the river shortly after the attack.

The Justice Department's Tucker said investigators across the country have conducted "hundreds of interviews." The first formal arrest came Friday, when a man was stopped at New York's John F. Kennedy International Airport for having a false pilot's license.

Tucker said a second arrest warrant was issued yesterday and the suspect taken into custody in New York. Officials declined to name either witness and said the records were sealed.

Federal investigators had hoped to obtain critical information about the hijackings from the downed planes' "black boxes," but the recorders on the jets that crashed into the Pentagon and into rural Pennsylvania were badly damaged, Tucker said, and are being returned to the manufacturer in hopes that some data can be retrieved. According to the Justice Department, there were cracks in the circuit boards of both of the black boxes aboard Flight 93.

Meanwhile, the Immigration and Naturalization Service was holding 25 people on a variety of infractions and questioning all of them about the Sept. 11 attacks, Tucker said. The two men detained Wednesday in Fort Worth were sent to New York.

Lori Bailey, an FBI spokeswoman in Dallas, said the two Fort Worth detainees were taken off the train by Drug Enforcement Administration agents conducting a routine narcotics sweep. They were riding from St. Louis, apparently having disembarked from an aircraft, and were en route to San Antonio, she said.

The pair told agents they were from India but had no documents. They were carrying $5,000 in cash and a box cutter, Bailey said.

In Maine, Portland Police Chief Michael Chitwood said yesterday that police and the FBI combed the city's Jetport parking lot before dawn Wednesday until they found the metallic blue rental Nissan Altima driven by Alomari and Mohamed Atta, then handed it over to FBI technicians who arrived early Thursday and worked on it until 9 p.m.

At Boston's Logan Airport, investigators discovered a bag left behind by Atta and containing a Saudi passport, an international driver's license, instructional videos for flying Boeing airliners, an Islamic prayer schedule and a suicide note written in Arabic, a source familiar with the investigation said.

And, in a security sweep of the Logan parking garage at 2 a.m. Thursday, investigators found a box cutter, a pamphlet written in Arabic and a credit card, items apparently discarded by the terrorists as they entered the airport.

Documents sent by the FBI to German police, and obtained by the German magazine Der Spiegel, indicate that some of the suspected hijackers aboard the plane that crashed into the Pentagon had purchased their tickets in tandem and through the most ordinary means.

Khalid Al-Midhar used a Daytona Beach address to book a reservation over the American Airlines Web site, using his frequent-flier number, which he had established the day before, according to FBI documents cited by the German magazine. He picked up the ticket at the Baltimore-Washington International Airport on Sept. 5, paying cash. His assigned seat was 12B.

Staff writers Marcia Slacum Greene, Scott Higham, Sari Horwitz, Serge F. Kovaleski, George Lardner Jr., Vernon Loeb, Michael Fletcher, Eric Pianin, and Cheryl W. Thompson and special correspondent Catherine Skipp contributed to this report. Correspondent Peter Finn reported from Germany.

Justice Department spokesman Mindy Tucker said a second material witness was arrested in New York.