They came by the tens of thousands, crowding the highways on foot, walking from as far as Basra and Nasiriyah to the south and Baghdad to the north. They carried green flags, representing Islam, and black flags, a sign of mourning. The women were covered head-to-foot in black robes. Many of the men wore red-and-white-checkered kaffiyehs on their heads.

The pilgrimage to Karbala on foot -- in a sandstorm that swirled for part of the way -- came in advance of one of the holiest days of the Shiite Muslim calendar on Tuesday. That's the traditional mourning day for Hussein, son of Ali and grandson of the prophet Muhammad, whose ornate shrine here in Karbala is one of Shiism's most revered sites. But the occasion this year carries special resonance.

For more than three decades of rule by the secular Baath Party, Shiite rituals such as walking to Karbala were discouraged or banned. Pilgrims still walked here to mark Hussein's death, but they were fewer in number, they never traveled in large groups and they had to move through -- or sneak around -- checkpoints set up by the security forces of the now-deposed president, Saddam Hussein.

Haider Abdul-Abbas, 25, who walked here from Samawah, about 125 miles southeast of Karbala, said he was jailed for six months for making the pilgrimage in 1997. "I told them I am only going to the mosque of Imam Al-Hussein," he said. "They said this is not allowed. This is something we must do as Muslims, so I am glad that we are now free of Saddam Hussein."

Some pilgrims stopped to rest on the highway median strips, or to sip water at makeshift stands set up along the route. Some stopped to sing and pray. Those who had already arrived in Karbala went straight to Hussein's tomb inside the shrine, to kiss the gilding and leave Iraqi dinar notes as gifts.

The city prepared to receive several million pilgrims. Neighborhood committees set up tables to dispense free food and water to the pilgrims, who will mostly sleep shoulder to shoulder on the sidewalks and in the large squares around Hussein's shrine and the adjacent shrine of his half-brother Abbas.

But with this being the first large Shiite ceremony since Saddam Hussein was toppled in Baghdad, much of the emphasis was on the freedom people now felt to openly engage in practices and rituals long outlawed. Shiites make up about 60 percent of Iraq's 24 million people, but they were largely excluded from positions of political power during Hussein's rule, and displays of their faith were frowned on.

Some Shiite worshipers were busy preparing the swords they will use to hit their heads to simulate pain and suffering. One street vendor was selling cassette tapes of religious songs that are used to accompany the ritualistic self-flagellation with whips that the Baath government disallowed. Other sidewalk hawkers sold photos of slain Shiite cleric Mohammed Bakr Sadr and Mohammed Hussein Fadlallah, the spiritual leader of the Lebanon-based Hezbollah guerrillas.

"Al-Sadr's picture used to be forbidden here," said Faleh, 27, a street vendor. "Many people like his picture." Before, Faleh said, he might have received five or 10 years in prison for openly displaying the picture of a figure killed by the government on charges he promoted opposition to Hussein. "I feel happy now that I can do what I like," Faleh said.

In past years, worshipers said, the government posted tanks and armored vehicles around the city and at the entrances to the mosques to prevent the huge Shiite religious gathering from turning into an anti-government rally.

Mohammed, 31, who runs a shop selling natural drugs and herbs, was busy in a tiny back-street souk hoisting a giant salmon-colored silk flag he intended to carry next week. "It was forbidden," he said, making a slashing motion across his throat and then holding his wrists together to simulate being handcuffed, to suggest the possible punishment in the past for such an indiscretion.

Now, he said, "This will be the happiest day of my life. We suffered a lot, a lot, to have such a day as this. The youth of Karbala send their regards to Mr. Bush. If we could vote, our votes would be for Mr. Bush."

Mohammed declined to give his last name when asked, betraying lingering anxiety about the unknown whereabouts of Hussein and his ability to reappear and exact revenge. He said only, "We're still not sure, because we haven't seen. Where is he?" Referring to the 1991 Shiite uprising in southern Iraq, which the United States encouraged but which Hussein's military crushed, Mohammed added, "We were fooled once."

After years of repression, Shiites in southern Iraq are feeling not only a surge of religious emancipation but also a new sense of political entitlement -- a sentiment that could complicate U.S.-led efforts to establish a broad-based, liberal government encompassing all the country's secular, religious, ethnic and tribal factions.

Already, some Shiite religious factions have distanced themselves from U.S.-sponsored talks that were held on Tuesday in Ur, near Nasiriyah. And many of the Shiite faithful, who are followers of the conservative Hawza seminary based in Najaf, the Shiite religious center, say they will not accept any government that is not ordained by Hawza.

"Whatever al-Hawza decides, we will accept," said Ali Hussein Ali, 39, the caretaker of the Hussein shrine. "We don't want ex-Baathists. We want sincere people who will work with al-Hawza. We don't say they must be religious people."

Hawza's influence is cited with increasing frequency in southern Iraq as Shiites become more open about discussing the country's political future and clerics' role in the next government. At Saddam Hospital in Nasiriyah this week, a doctor named Haitham Gizzy, when asked his political views, replied: "I am a Shiite, so I must follow the Hawza group . . . same as in Iran. The leader can be a religious man. All of our population would like to have a religious leadership."

A Hawza representative in Karbala, Hussein Hameed, 31, said his group had already taken control of the Hussein and Abbas shrines. "For 35 years, Saddam and the Baath took advantage of the Shiite people," he said. "Now we are free as Muslims."

But for many Iraqi Shiites, religious conviction seems less important than getting a government that can provide security, restore basic services such as electricity and water, and give the country a sense of normality.

"We think the most important thing is for Iraqis to control the new government," said Jawad Sabagh, 70, the owner of Karbala's Moon Hotel. "We need a sincere, faithful person, respecting the rights of all people, whether he is Shiite, Sunni, Christian."

Shiite Muslims read announcements posted outside the shrine where Hussein, the grandson of the prophet Muhammad, is buried. Saddam Hussein hindered or banned pilgrimages there.