A University of Michigan student tossed a firebomb into a hallway on the sixth floor of his dormitory yesterday and then opened fire with a sawed-off shotgun on a crowd of students as they fled through the smoke-filled corridor.

Two students were killed by shotgun blasts in the attack, and police said they had no motive for the apparently random act of violence. A suspect identified as Leo E. Kelly Jr. of Detroit, a 22-year-old psychology student, was in police custody.

Officials at the University of Michigan and other colleges yesterday called the incident bizarre, comparable to the infamous Texas Tower shootings of 1966, when a former Marine honor student stationed himself atop a University of Texas tower and shot 13 people to death.

Ann Arbor police said Kelly, who lived alone in a room on the sixth floor of Bursley Hall dormitory, apparently tossed a Molotov cocktail down the hall from his room at about 6 a.m. yesterday, filling the hall with smoke and sending pajama-clad students fleeing into the corridor.

According to police, university officials, and several witnesses, he then went to his own room, returned to the hallway with a sawed-off shotgun, and opened fire randomly into the crowd.

Kelly was arrested after returning to his room and shutting the door, apparently to wait for police, according to various accounts of the incident.

Fatally wounded in the hallway were a 19-year-old freshman, Edward R. Siwik of Detroit, and a 21-year-old junior, Douglas C. McGreaham of Caspian, Mich., a dormitory resident adviser who lived one floor below where the shooting incident took place.

Siwik was pronounced dead at the University of Michigan Hospital about a half hour after the shooting. McGreaham died about an hour later at nearby St. Joseph Mercy Hospital.

No other students were known to be seriously injured in the attack.

A police spokesman, Lt. Harold Rady, said, "We have no link between the victims and the suspect -- no motive."

Students who lived near the suspect painted a picture of a loner with no known friends, who moved to the floor at the start of this term in January and never joined in activities with the others on the hall.

"He never wanted to talk to anybody," said one student who lived down the hall from Kelly. "He never came out. Our hall is pretty friendly, but he didn't want to meet anyone."

Yesterday's attack was the second shooting incident at that same high-rise dormitory in just over one month, and the third in just over a year, according to police and university officials.All the incidents apparently were unrelated and the earlier ones were relatively minor, involving a domestic squabble between two dormitory employes in one case, and a scuffle March 8 of this year that ended when one person fired a shot from a revolver.

Yesterday, University of Michigan President Harold Shapiro issued a statement expressing "heart-felt condolences."

"The humaneness of us all has suffered a loss and we must do whatever is necessary to construct a community where this type of incident will not recur," the statement said.

The University Regents, in session yesterday, passed a motion deploring the action.