BATU CAVES, Malaysia (AP) _ The pre-dawn mist melted quickly but was replaced by swirling smoke from tiny devotional fires as thousands of Hindu pilgrims prepared for their annual day of penance.

Their rites began at the river as they splashed in dirty water and prayed with relatives and friends. Mothers led their toddlers into the stream.

A man dressed only in shorts and with his head freshly shaved stepped from the water into a shuffle dance while others chanted encouragement and lit incense. His eyes glittered, he drooled and his limbs twitched spasmodically. The chanting became louder and his dance more frenzied as sacred ash was slapped on his head. The frenzy subsided in a few minutes and he seemed to fall into a trance.

Helping hands perched him on a small stool and carefully forced a metal spike the size of a knitting needle through his cheeks. A smaller rod was run through his tongue from top to bottom. Helpers attached barbed hooks weighted with limes to his back.

He didn't bleed and he suffered no apparent pain.

This was Thaipusam in the Tamil lunar month of Thai, when the moon is in transit across the brightest star, Pusa, in the zodiacal sign of Cancer. It was Thursday in Malaysia this year, and the scene described at Batu Caves, nine miles north of the capital Kuala Lumpur, was repeated elsewhere in the country by the Hindu devout on that day.

Officials expected more than 500,000 at Batu Caves for the 2 1/2 -day festival. The annual mortification of the flesh is done to pay homage to the Hindi deity Lord Subramaniam, seek atonement, give thanks and fulfill vows.

Thousands of bedazzled foreign tourists also made the trek, lending the religious ceremony the raucous atmosphere of a carnival sideshow complete with a Ferris wheel, trinkets and balloons.

Featured players at the festival were the 3,000 who registered with temple officials to carry a ''kavadi.''

These ranged from relatively small wooden yokes decorated with peacock feathers, tinsel and brightly colored paper to 60-pound steel frames with dozens of spikes to penetrate the flesh at many points. The kavadi symbolizes Paravani, Lord Subramaniam's peacock steed.

To the uninitiated, Thaipusam at Batu (Stone) Caves is a jolt, a stunning assault on the senses where intense religious devotion is expressed among a throng of gawking sightseers.

While family and friends and devotional songs and beat drums, humans covered with hooks, cheeks pierced with spears and tongues with arrows, walked a half-mile from the river to 272 concrete steps leading to Cathedral Cave.

The procession was a start-stop affair as cars edged through the dusty column and the gates were occasionally lowered at a grade crossing between the river and the cave for passing trains. Kavadi carriers passed several acres of temporary stalls offering food, drink, clothing, toys, wood carvings and pictures of Indian movie stars. Baubles, bangles and beads were available along with vitamin pills and ''Govinda's Vegetarian Pizza.''

Bearded mendicants solicited alms. Small boys sold camphor pellets to be burned as devotional flames by the faithful once inside the cave. A tour director cautioned his camera-toting charges against pickpockets.

Kavadi carriers shuffled faster and whirled in circles as they approached the steps. Several insisted on making the climb in quick spurts of 20 or more steps at a time.

The stairs are divided in the middle, with human traffic kept to the left going up and descended on the right. Soldiers, police and white-suited first- aid attendants helped control the crowd.

The vast limestone cave was lit inside by strings of electric lights, devotional fires and a beam of daylight from a vertical shaft through the top at one end. Thousands packed the main floor of the cavern, which smelled of incense, sweat, jasmine and bat dung.

Penitents headed for a grotto holding the jewel-encrusted image of Lord Subramaniam. A priest removed the spikes and some kavadi carriers collapsed in exhaustion and religious fervor. Sacred ash and lime juice was applied to their wounds, but even after the trance lifted. there was no apparent pain.

Several years ago, researchers from the United States and Australia separately investigated the seeming lack of pain, but without conclusive results. They did say that the lime juice and sacred white ash, found to be mostly burned cow manure, had nothing to do with it.

The few willing to talk about their deed said it was done for intensely personal reasons. One said he vowed to carry a kavadi for three years after he regained his health after a motorcycle crash. Another said he did it to honor his father.

The tradition at Batu Caves originated before the turn of the century, temple chairman S. Sockalingam said. Hindus in India have many sacred places in hills and mountains, and there are celebrated cave temples. Tamils from southern India brought the observance of Thaipusam when they came to what was then Malaya to tap rubber.

India has banned such self-torture but it continues here with unabated fervor. Sockalingam said some of the wooden rods used to pierce the cheeks had been growing so long that a one-yard limit was imposed this year.