PAPEETE, French Polynesia (AP) _ Two dozen islanders accused of torturing to death six people have told a court they were possessed by the devil or seized by religious fervor during a hunt for evil spirits in 1987.

All week the jury has been considering the case, which focuses on two days of terror on the remote atoll of Faaite after a visit by three women who claimed to represent a charismatic movement founded in the United States.

Psychiatric experts testified that the charismatic movement, mixed with ancient Polynesian beliefs in the supernatural, produced a dangerous mix on an isolated island lacking institutional authority.

The three women, whom investigators ruled never ordered the killings, are not on trial.

But witnesses say the violence had its roots in a visit that August by the three women from Tahiti, about 310 miles west.

''I had a spirit under the spell of the devil,'' one of the islanders from Faaite told Judge Marcel Bihl of the Papeete Tribunal on Thursday. ''I lost my head, but I believed I was on the holy path, shunning the evil fighting within me.''

Other defendants, clad in bright tropical shirts and white trousers, said they lost self-control during the search for demons and sorcerers.

The 24 defendants are charged with murder, inciting violence and other offenses.

The women claimed to represent the Charismatic Renewal, a movement founded in 1967 and affiliated with the Roman Catholic Church. However, church authorities said they had no connection with the women.

At the time, the movement already had a strong following on Faaite, an atoll studded with white sand beaches and about 180 residents.

The women, regarded as priestesses by the islanders, took over the tiny whitewashed church and, by force of personality, replaced the lay preacher as the religious authority on the atoll, witnesses said.

The trio's leader, Alexandra Silvia, conducted services in a trance and told frightened islanders of her visions that God would abandon Faaite, the defendants said.

She suggested demons were in their midst, and the population began viewing with suspicion fellow islanders who failed to attend her daily services.

In late August that year, the trio left Faaite and gave roses to seven islanders, designating them as disciples to continue their work.

On Sept. 2, Ioane Harris, the assistant mayor, publicly denounced what was happening.

One defendant told the court he looked into Harris' eyes and believed him possessed. Maddened villagers tightened a cord around Harris' neck, held a crucifix before his face, and beat him senseless.

They then drowned Harris during a ritual in the lagoon and threw his body on a bonfire built under palm trees in front of the church.

''It was necessary to purify him,'' one of the defendants calmly told the court. ''It was necessary to purify the village.''

Five more people were killed over the next two days. One, a mentally handicapped young man who claimed to be Jesus Christ, was burned alive.

Informed of the killings, the mayor arrived on Sept. 4 with a Catholic priest and a squadron of police in time to stop further violence.

The jury was expected reach a verdict after two weeks' testimony.