RANCHO SANTA FE, Calif. (AP) _ Thirty-nine members of a high-tech cult killed themselves in shifts with drugs and vodka after packing their bags in anticipation of a rendezvous with a UFO trailing the Hale-Bopp comet.

The group also mailed out videos in which their leader described the hoped-for space encounter and members came before the camera two at a time, side by side, to say their last goodbyes.

``A lot of it was real and not very scripted. It was very self-evident that they were winging it,'' said Nick Matzorkis, who went with a former cult member to the mansion and discovered the bodies after viewing the videos and a farewell letter the cult members had sent by Federal Express.

Matzorkis said the people on the video appeared very upbeat and many expressed pleasure that they were going to a better place.

``It seemed to be a group decision,'' San Diego County Medical Examiner Brian Blackbourne said Thursday at an extraordinary news conference detailing the death scene. ``It was very planned, sort of immaculately carried out.''

The victims included 21 women and 18 men, all with closely cropped hair and wearing identical black outfits. Police said the hair _ and the fact that decomposition had set in _ had made their gender and age difficult to determine at first.

Most were found with little pieces of paper containing a suicide recipe: take pudding or applesauce and mix it with phenobarbital, drink it down with alcohol, lie back and relax.

The victims apparently committed suicide in separate groups: 15 the first day, 15 the second and the remaining nine the third day, each with a plastic bag over their head to hasten the deaths, Blackbourne said.

The deaths came days after the group, which operated a successful web design company under the name ``Higher Source,'' updated their ``Heaven's Gate'' web site on the Internet with a statement saying the comet's appearance meant their time had come.

``Hale-Bopp's approach is the `marker' we've been waiting for,'' says the statement on the World Wide Web site. ``We are happily prepared to leave `this world.'''

One of the videos has an ethereal look, showing triple images of a bald, elderly man in a black, collar-less shirt on a white plastic patio chair who apparently is beckoning followers to leave the Earth, Matzorkis said.

That man _ who also goes by the name ``Do'' _ could be Marshall H. Applewhite, who along with a colleague named Bonnie Lu Trusdale Nettles persuaded hundreds of people in California, Colorado, New Mexico and Oregon to leave families and belongings behind and join them in 1975.

The couple referred to themselves then as ``The Two.'' The Heaven's Gate home page also refers to the founders as ``The Two,'' and says they began ``rounding up their crew in '75.''

On the video, the founder of the Heaven's Gate cult gives a history dating back to the 1970s, when the group was known as the ``UFO Cult,'' said Matzorkis, president of Interact Entertainment Group in Beverly Hills.

The package arrived late Tuesday, and the letter said they group would have committed suicide already, prompting Matzorkis and his employee, whom he would identify only as Rio, to rush down to the mansion on Wednesday. They called police after finding the bodies.

``By the time you read this, we suspect that the human bodies we were wearing have been found, and that a flurry of fragmented reports have begun to hit the wire services,'' the letter said.

``We'll be gone _ several dozen of us. We came from the Level Above Human in distant space and we have now exited the bodies that we were wearing for our earthly task, to return to the world from whence we came _ task completed,'' the letter said.

Applewhite may be among the dead. His date of birth has been listed in state records as May 17, 1931, making him 65. The victim's list includes a 66-year-old male.

Among those saying farewell is a woman with short cropped hair seated next to a younger man with a buzz haircut who sat stiffly and occasionally fidgeted.

``Maybe they're crazy for all I know but I don't have any choice but to go for it because I've been on this planet for 31 years and there's nothing here for me,'' the woman said.

Matzorkis said Thursday that another member told him several months ago that a space ship following the comet was coming to pick them up.

``They did not say they were going to commit suicide, but they did indicate to me that they would be leaving the planet,'' Matzorkis said.

The meticulously planned deaths were described at a news conference Thursday, held at the county fairgrounds to accommodate the crush of media, where authorities released a video showing the bodies inside the mansion.

Blackbourne said the second group cleaned up after the first, the third after the second. The last two alive removed plastic bags from the last seven bodies and then killed themselves.

``We believe they were the last ones and they did have plastic bags over their heads,'' Blackbourne said.

The dead ranged in age from 20 to 72, and because each had closely cropped hair, it was difficult initially to determine their sex. Most had identification packets in their shirt pockets.

One victim was Canadian, two were black, a few were Hispanic and the rest were white, he said. Authorities withheld IDs until family members were notified.

Each victim had a packed suitcase at the foot of their bed or cot, and each had $5 bills and quarters in their pockets, Blackbourne said.

Police showed a videotape taken from inside the mansion showing bodies all dressed in black _ identical Nike running shoes, long-sleeve shirts and pants _ lying on neatly made bunk beds.

``It appeared as if it were almost a uniform attire,'' said Sheriff's Cmdr. Alan Fulmer.

All had purple shrouds covering their upper bodies, and some had eyeglasses folded carefully at their sides. Computer equipment filled the nine-bedroom house.

``Who or what would make 39 people take their life in this manner? While at the scene last night, I told myself that the question cannot be answered in terms, I think, that the rest of us will ever understand,'' Sheriff Bill Kolander said.

But the group explained their final act, in a way, in a huge tome they posted on the Internet, titled ``How and When `Heaven's Gate' May be Entered.''

``We've acknowledged that if there ever was a cult or culture that was different, and unique, and unlike the world, and doesn't have a place in the world, then we take the prize, I guess, of being the cult of cults,'' Do writes.

A member identified only as Anlody adds his reasons for committing suicide on one of several ``exit statements'' in the online book:

``Survival requires that you allow nothing of this human existence to tie you here. No wealth, no position, no prestige, no family, no physical pleasure, and no religion spouting to hang on to any of the above will enable you to survive. They are only entrapments.''