DAKAR, Senegal — For years he ran an intense and bombastic campaign against the Nigerian government from his hide-out somewhere in exile.
But on Tuesday afternoon, Nigeria’s most-wanted fugitive appeared in court in the capital, Abuja, hooded, flanked by security agents and facing charges that included treason.
Nnamdi Kanu, leader of the Indigenous People of Biafra, a secessionist group in the West African country’s southeast, had not been seen in Nigeria since he was released on bail in April 2017 and then disappeared.
But in his absence, Mr. Kanu loomed large.
He attracted many more supporters to his fight to restore the independent state of Biafra, and his popularity and profile have only grown — partly as a result of the Nigerian government treating him as a serious threat, analysts said.
It has been 50 years since Nigeria’s civil war, in which Biafra battled to maintain its independence from the newly independent nation of Nigeria. As many as one million people may have died, many of them of starvation. Biafra eventually surrendered, but in recent years many residents of the southeast have taken up the cause again.
Mr. Kanu has capitalized on the perception that the federal government is prejudiced against the people of the southeast, many of whom belong to Nigeria’s third-largest ethnic group, the Igbo.
Prone to inflammatory rhetoric, he has referred to Nigeria as a “zoo” and often repeats the false claim that the Nigerian president, Muhammadu Buhari, secretly died and was replaced by a body double from Sudan named Jubril.
The circumstances of Mr. Kanu’s return to Nigeria were shrouded in mystery..
“Recent steps taken by the federal government saw to the interception of the fugitive Kanu on Sunday,” Nigeria’s attorney general and justice minister, Abubakar Malami, said in a statement.
In addition to the charges brought before Mr. Kanu jumped bail, he said Mr. Kanu was accused of inciting violence through his broadcasts, including on Radio Biafra, and of instigating violence that resulted in the loss of lives among civilians and the security services.
The media secretary of the Indigenous People of Biafra, popularly known as I.P.O.B., said he had been lured into a trap, but could not say how or where. A spokesman for the State Security Service, Nigeria’s intelligence agency, did not respond to requests for comment.
Nigerian lawyers speculated on Twitter that extradition from the United Kingdom, where Mr. Kanu is a citizen, was unlikely because it usually takes many years. The Metropolitan Police in London declined to comment.
Mr. Kanu did tell the Federal High Court Tuesday about the circumstances in which he had left, in 2017.
“I went underground because my house was raided,” he told the court. “I had to escape, otherwise I’d have been killed.”
Reporters who visited his house after the raid said it was riddled with bullets and the windows were smashed. Mr. Kanu’s brother said soldiers had killed around 20 I.P.O.B. members. The military denied responsibility for the raid.
On Tuesday, Mr. Kanu’s lawyer, Ifeanyi Ejiofor, said his client had been brought before the court without the knowledge of his legal team.
The separatist group’s media secretary, Emma Powerful, said that he had last spoken to Mr. Kanu two days ago, but that he did not know where he was calling from.
The next thing he knew, his boss was being led into court in the Nigerian capital, he said. Pictures were circulated on social media of Mr. Kanu in handcuffs and a Fendi tracksuit.
“The saboteurs among us tried to lure our leader into another trap,” Mr. Powerful said.
Nigeria, Africa’s most populous country, is facing many security issues, among them kidnapping, militancy in the oil-rich Niger Delta and the threat of Islamist groups in the northeast.
Nevertheless, the government has focused military and monetary resources on combating the I.P.O.B., and President Buhari has been outspoken on the issue.
Two weeks ago, Mr. Buhari’s post on Twitter drawing a connection between the civil war and recent attacks in the southeast was removed by the social media site. The government then decided to ban Twitter in Nigeria altogether.
Some believe the government’s tactics have backfired.
Cheta Nwanze, a partner at the Lagos-based risk advisory group SBM Intelligence, said Mr. Kanu “has become increasingly popular over the last few years as Buhari’s methods have won him a lot of sympathy.”
Nigeria’s struggling economy has given Mr. Kanu still more standing.
“As things have gone wrong,” Mr. Nwanze said, “he has looked more and more like a prophet.”
Ruth Maclean reported from Dakar, and Ben Ezeamalu from Lagos, Nigeria. Mady Camara contributed reporting from Dakar, and Elian Peltier from London.