— Saif al-Islam Gaddafi, the favored son of former Libyan leader Moammar Gaddafi, was arrested on the border with Niger and taken to a mountain city, where he awaits an uncertain fate, militia leaders said Saturday.

Gaddafi was detained while his supporters were trying to smuggle him out of the country and then transferred to Zintan, in western Libya, according to Othman Maigeta, a brigade commander. Zintan is home to one of the largest groups of fighters that swept across western Libya and helped topple the government in August.

Joy broke out in the streets of the capital as the news was announced on Libyan television. People hugged and wept as cries of “Allahu akbar!” (“God is great!”) filled the air. The red, black and green revolutionary tricolor streamed from passing cars as drivers honked and flashed their lights.

Moammar Gaddafi was captured outside his home town of Sirte last month but was immediately killed and quietly buried in the desert. Libyan officials have expressed regret that he was not treated more humanely or given a fair trial.

The whereabouts of the younger Gaddafi had been unknown since Tripoli fell to rebel forces three months ago.

Representatives of the fighters in Zintan said that he would be turned over to the Transitional National Council when a new government has been formed, expected in the next few days when interim Prime Minister Abdurrahim el-Keib announces his cabinet.

But the fact that the captors were regional fighters rather than official national forces raised questions about whether proper judicial procedures would be followed, said Fred Abrahams of Human Rights Watch.

As regional groups jockey for power in Libya, the fighters in Zintan could be tempted to hold on to the prominent figure for political leverage. And even if he is transferred, there are doubts about what will happen to him.

“Saif’s treatment is a test for the new Libyan government to show that they are turning their backs on the abusive practices of the last four decades,” Abrahams said. “The revolution was about breaking the traditions of abusive justice, and they have an opportunity to demonstrate that they will do that.”

According to U.N. Security Council Resolution 1970, Libya’s interim leaders are obliged to turn Gaddafi over to the International Criminal Court for trial on charges that include crimes against humanity.

But Ibrahim Dabbashi, Libya’s deputy ambassador to the United Nations, said the vast majority of Libyans want the trial to take place in their country.

The interim government “is trying to do its best to ensure the safety of Saif al-Islam and to transfer him to Tripoli as soon as possible,” Dabbashi said. But he expressed concern about the government’s ability to do so, saying the crowds that turned out to see him “have tremendous hate against him.’’

Dabbashi added that he understood that a delegation from the international court, including prosecutor Luis Moreno-Ocampo, would soon arrive in Tripoli to discuss the matter.

Saif al-Islam, the eldest son of Gaddafi and his second wife, was a prominent international spokesman for the government. He was educated in London and portrayed himself as a reforming force, heading human rights and economic groups and planning to open a democracy institution, before armed uprisings against his father began in February.

He became a leading force of the government’s struggle for survival, warning in television tirades that there would be “rivers of blood” if rebels continued to fight and swearing that “we will fight until the last man, the last woman, the last bullet.”

Many Libyans say they were terrified of the man who seemed likely to be their next leader.

“This is the first time I felt secure,” said Adel Abdulnadi, a taxi driver in Tripoli, who was flying the new Libyan flag from his window. He called for the arrest of intelligence chief Abdullah al-Senussi, also wanted by the ICC, “and then there will be no more tyranny in Libya.”

Kekly is a special correspondent. Fordham reported from Beirut. Staff writer Colum Lynch in New York contributed to this report.