HAMBURG, Germany, Sept. 16— To the deep embarrassment of German security officials, a small technical university on the southern edge of this wealthy port city unknowingly harbored a cell of Islamic fundamentalists, a group that included at least three of the hijackers who carried out and perished in the terrorist attacks on Tuesday.

The trio included Mohamed al-Amir Awad al-Sayed Atta, who was on American Airlines Flight 11, the first plane to crash into the World Trade Center, and Marwan Yusef Mohammed al-Shehhi, 23, who was on the second plane to ram the towers.

But German officials now say a third man who studied in Hamburg was involved. He was Ziad Jarrahi, 27, born in Lebanon, a Sunni Muslim from the village of Al Marj in the Bekaa Valley. He took courses here in flight engineering and aircraft construction and had a Hamburg pilot's license. When he left Germany in June 2000, after some four years here, he left behind a girlfriend in Bochum, an industrial city 200 miles southwest of Hamburg. There, said Kay Nehm, the federal prosecutor, the police found in their apartment a suitcase with ''airplane-related documents.''

The girlfriend, identified here only by her last name of Senguen, is now in a witness protection program, Mr. Nehm said. She had originally contacted the police to report Mr. Jarrahi missing. He died on United Airlines Flight 93, which crashed in Pennsylvania short of its unknown target.

Less than 36 hours after the terror attacks, the German police received a list from the F.B.I. of 13 people suspected of links to the terror. Since the early hours of Thursday, some 100 German investigators -- joined late last week by an unknown number of F.B.I. agents -- have scoured 14 Hamburg apartments and detained nearly a dozen people for questioning.

The German police, who are accustomed to monitoring foreign extremists, are providing little information. ''The investigation is so difficult because these were people who never caused a stir,'' said Mr. Nehm, the federal prosecutor.

The latest annual report of the Office for the Protection of the Constitution identified 58,800 members of ''foreign extremist organizations'' living in Germany. Of those, 31,450 were said to be Islamic extremists, most of them Turkish or Kurdish. Some 5.5 percent are Arab, and 1.7 percent are from Iran, according to the 2000 edition of the report.

In Hamburg itself, a city of 1.7 million with some 80,000 Muslims, there are about 2,450 extremist foreigners, only 270 identified in the report as Iranian or Arab. According to the report, the Palestinian group Hamas does significant fund-raising here, and Osama bin Laden's Al Qaeda organization has individual members, relying ''on personal contacts and a global network structure.'' On Dec. 26 last year, the German police announced a blow against Mr. bin Laden, arresting four men in Frankfurt on terrorism charges and seizing an arsenal of rifles, handguns, machine guns, homemade detonators, a grenade, false documents and a quantity of potassium permanganate for potential bomb-making. The police, who passed on information to Britain and France that later led to further arrests in London, said the men had received training in Mr. bin Laden's camps.

The current investigation is focused on the Technical University of Hamburg-Harburg. The weekly newspaper Die Zeit, based in Hamburg, said in a special edition to be published on Monday that as many as four more suspects on the F.B.I. list might have been registered at the university. The chancellor, Jörg Severin, found 7 of the 13 names on the F.B.I. list when the police asked him to look into the university's files late Wednesday night.

In interviews with people who knew him here, Mr. Atta, the apparent leader of the cell, emerges as the most compelling figure. Thirty-three years old when he undertook his deadly mission last Tuesday, he was registered here for more than eight years and in 1999 started an Islamic prayer group at the university and apparently began to recruit for fundamentalist causes.

His apartment became a center for other Arabs, and Mr. Atta and his friends spent a lot of time, neighbors say, at a nearby cafe, making long distance calls from public phones.

According to his professor, Dittmar Machule, and two of his best German friends, who spent almost three months with Mr. Atta in Cairo in 1995, he was a man of deep intelligence and religious belief who began to grow very angry.

Ralph Bodenstein, one of the friends invited to Cairo, described Mr. Atta's father as a well-off lawyer and said Mr. Atta became more open and relaxed in Egypt, but also increasingly angry about Western policy toward the Middle East.

''He was not anti-Western in a cultural sense,'' Mr. Bodenstein said in a telephone interview from Beirut, where he is doing doctoral research. ''He was shocked by the Oslo process and the role of the United Nations and the United States and the European powers in the gulf war. It depressed a lot of people, that this war was being waged for Western interests, and that even their own government in Egypt was selling out the interests of the people to gain material advantages.''

Mr. Atta's views were not uncommon or even especially radical, Mr. Bodenstein said, and he had a real and consuming interest in urban planning. ''But he was very angry, and in some sense he became desperate about it,'' he said. ''I saw in him a process of increasing embitterment, and that is the only thing I can state now, looking back. He apparently must have changed a lot to do this and moved in directions that were not foreseeable.'' Mr. Atta's thesis adviser, Mr. Machule, said Mr. Atta began to change ''around 1995,'' when he grew a longer beard.

But Mr. Atta's 1999 thesis on city planning in Aleppo ''was excellent, and if you crossed out his name, it's the most neutral thesis you'll ever see.''

Mr. Machule noted, however, that in the final version of the thesis, where Mr. Atta thanked his professors, he had placed a striking quotation from the Koran.

''I can't remember it precisely,'' Mr. Machule said. ''But it is something like this: 'My life, my death, my sacrifice belongs to Allah, the lord of worlds.' ''

Born in Kafr el Sheik, Egypt, Mr. Atta called himself el-Amir at the Harburg university, registered as a citizen of the United Arab Emirates and also carried a Saudi passport.

Besides his trips to the United States for flight training, he visited Syria -- sometimes for his thesis -- and, according to the Spanish newspaper La Vanguardia, made at least two trips to Spain. There, he reportedly met other terrorism suspects or controllers who might have been involved in the attacks last week.

The Spanish newspaper said he flew from Miami to Madrid in January, and then in July, after leaving Germany for good in May, he visited Spain again, ending up at the resort town of Salou, in northeastern Spain, before returning to Florida.

Mr. Shehhi was at the Harburg university just a year, and rarely attended courses, but was inseparable from Mr. Atta here and later in Florida, where both took flight training courses and shared an apartment.

Photo: Ziad Jarrahi was on the plane that crashed in western Pennsylvania. (Associated Press)