Ka Madi leaned against a wall scorched by fire and spoke with his eyes locked shut, as if conjuring up something buried deep in the past instead of the harsh realities of the past five months.

Madi, 43, is from Burkina Faso, but he has lived in Ivory Coast since he was 10. He used to have a good job selling cola nuts, the pink, caffeine-packed beans chewed in religious ceremonies and often offered as gifts. He was important, a leader involved in the town's politics. He used to pray at a roomy mosque with thousands of other Muslims.

That was before September, when civil war erupted in Ivory Coast, before rebel factions in the north and west seized control of half the country, before simmering tensions over religion and ethnicity boiled over in many towns, including Agboville, 55 miles north of Abidjan.

Two weeks ago, men with guns took lighters and gasoline and burned Madi's neighborhood mosque. They told him he was no longer wanted in this country, that he and his children should go, because they were not really Ivorian.

"It pains me to say it, but if they gave me Ivorian citizenship right now, I wouldn't want to take it," Madi said as he stood in the blackened alley outside what used to be his mosque. "Before all of this, we had a peaceful life. It's the politicians that did this to us."

Since the on-again-off-again civil war started, splitting the country between the poor, mostly Muslim north and the more prosperous, largely Christian south, the most explosive issue in cities and villages has been the question of who is a "true Ivorian." The concept, known as ivoirite, has made enemies of neighbors and co-workers who once got along and never questioned nationality. The esteemed "certificate of nationality," which courts issue to citizens who can prove that both their parents are native Ivorians, has become an obsession for many people.

While the legal requirements for certification are fairly simple, the larger questions surrounding ivoirite are murky, complex and easily manipulated, Ivorians say. Though this part of West Africa has been referred to as Ivory Coast for centuries, the independent country of that name came into existence just 43 years ago with the end of French colonial rule. Its present borders were established in 1947 to distinguish it from the seven other parts of French West Africa, and most -- if not all -- of its more than 60 ethnic groups extend beyond those borders.

"At heart, there really is no such thing as Ivorian, and people deep down inside know this to be the truth," said Martin Bleou, a chain-smoking professor of law at the University of Abidjan who is also president of the Ivorian Human Rights League. "But for now, politics and passions are overriding what has always been true in Africa. Now, where you are from matters more than anything else."

Alpha Blondy, a popular Ivorian reggae singer and political activist, was more blunt when he said recently that the country wants to "inspect one's mother's undergarments."

"It's black Nazism," said Blondy, who lives in Paris and was nominated for a Grammy this year for his album "Merci." "The only people benefiting from the madness are the people in politics."

The preoccupation with nationality represents a reversal of the attitudes that prevailed in the years right after independence. Under independence leader Felix Houphouet-Boigny, immigrants were welcome here, filling a need for low-wage farm workers in the world's leading cocoa-producing nation. Today, almost half of the country's 16.8 million people are immigrants or the children of immigrants.

But in the 1990s, Houphouet-Boigny died and cocoa prices plunged, crippling the economy. The country's second president, Henri Konan Bedie, blamed immigrants, as well as northern Ivorians, who shared the Muslim faith and ethnic roots of many foreigners, for the country's problems.

A disputed vote in 2000 gave the presidency to Laurent Gbagbo, whose supporters credit him with working for reconciliation and whose critics accuse him of continuing to exploit ethnic and religious divisions. On Sept. 19, a military uprising failed to topple Gbagbo but left the northern half of the country in the hands of rebels calling for his ouster.

In the ensuing civil war, immigrants' homes have been burned. The streets of Abidjan, the southern port that is Ivory Coast's commercial capital, were blanketed with the green, orange and white national flag and filled with marchers chanting: "Xenophobe, So What?"

Here in Agboville -- home to a mix of Ivorians from north and south and immigrants from neighboring Burkina Faso, Liberia and Mali -- fighting broke out after a French-brokered peace pact was announced Jan. 24. Gbagbo's supporters marched through the town, chanting "Ivory Coast for Ivorians," throwing stones at mosques and making threats.

Five mosques were burned. In retaliation, three churches were set on fire. Fifteen people died, some Muslim and some Christian, said Claude Chiedou Tetchi, the mayor of Agboville.

At the Methodist Protestant Church, worshipers recently discussed rebuilding their burned-out building. It was a Sunday, so the women walked through the rubble wearing tiny French-made high heels with bows, African head wraps and bright green and orange dresses.

"All we are interested in is rebuilding our church," said Peter Anoh, who teaches Sunday school and is a southerner but has relatives from the north. "Maybe this all went too far. We used to want our country for Ivorians. But it's too late -- everyone is here. We have to live together. Otherwise, it's this."

Across town, in a gas station reduced to a twist of melted metal, a man whose feet were covered in gooey black oil swept debris with a bundle of sticks while a group of friends -- northerners and southerners -- sat watching, waiting and chatting.

One of them, Prudence Agoh N'Guessan, 21, said that when she first started marching in protests she believed in the cause of promoting ivoirite. She heard student leaders on the radio talking about how immigrants were hurting the economy and were even part of the rebel groups. It made her angry, she said. She is a seamstress, and since the war no one has wanted new clothes and she has no work. So she took to the streets.

"But then the rally got too aggressive," N'Guessan said. "I think people became too upset."

"It's no good," said Ibrahim Doumbia, 40, a taxi driver from the north.

He turned to face her and said she should not be so easily swayed. "It's just political problems," he said. "It's not us."

"I know," she said, looking away and wringing her hands. "We were upset. Now we aren't anymore. I don't know."

Ibrahim Doumbia, left, a Muslim, and Prudence Agoh N'Guessan, a Christian, talk with friends about the destruction left in their town. They gathered in a gas station that was set on fire by protesters.Worshipers walk through the rubble of the Methodist Protestant Church in Agboville, where 15 people were killed in religious fighting that broke out after a peace agreement for Ivory Coast was announced last month.