LEWISTON, Maine - A prank in which a middle-schooler tossed a slab of leftover Easter ham onto a table surrounded by Somalian Muslim youngsters has exposed - yet again - the gaping cultural divide in this struggling former mill town.

Over the last six years, as many as 3,500 black refugees from the war-torn African country have settled in this nearly all-white, heavily French Canadian, and largely Roman Catholic city of 36,000, giving Lewiston the highest concentration of Somalis in America.

Along Lisbon Street, the main downtown thoroughfare, the latest newcomers to a city built by waves of immigrants have created a mosque, the Red Sea restaurant, and a couple of halal grocery stores as they try to adapt to their strange new world.

Women in colorful head scarves or ankle-length hijabs can be seen walking together, not far from the canals, the once-bustling mills, and the twin spires of the Basilica of Saints Peter and Paul, built with mill hands' dollars.

But the influx of Somalis has raised tensions.

In 2002, Larry Raymond, then the mayor, created a furor when he issued a letter asking Lewiston's Somalis, then numbering about 1,000, to advise their countrymen not to come here because the city's resources were "maxed out."

Tensions ran high again last summer when a man rolled a pig's head into a Somalian mosque during evening prayers. (Pork is considered unclean by Muslims.) The man, who said he did it as a joke, was charged with desecrating a place of worship. He committed suicide after a recent standoff with police.

Then, on April 11, came the ham incident. The student was suspended, and the Maine attorney general looked into whether the prank represented a hate crime. No charges were filed.

Haaruan Sheekhey, 27, a Somali who moved to Lewiston from Denver two years ago, said he was ready to try his luck elsewhere. His restaurant failed after it was hit by vandals who scratched a swastika on a window, he said, and employers are reluctant to hire Somalis.

"If somebody says 'I'm happy in Lewiston,' they're lying," he said. "We're having a hard time in this city. We're struggling. We're trying so hard to be part of this community, trying so hard to find a job, but nobody gives us a chance."

Others, however, say that the Somalis are assimilating well and that a few incidents do not reflect the way the newcomers have been accepted.

"Yes, there is some friction every once in a while, but that often gets blown out of proportion," said Pierrot Rugaba, program director for refugee and immigration services of Catholic Charities Maine. "Things have improved, but, like everything else, it takes time."

Many Somalis have moved into the city's housing projects, while others are clustered in the downtown area in aging three- and four-story tenements formerly occupied by French Canadian immigrants who worked at the textile mills in the city's industrial heyday in the late 19th and early 20th centuries.

By most accounts, language problems and a lack of job opportunities have proven to be the biggest hurdle to Lewiston's Somalis as they try to move up the economic ladder, leading many to shift their hopes and dreams to the next generation.

"Their children are the only assets they have. They left everything else in Somalia," said Said Mohamud, manager of the Mogadishu Store, a grocery.

Mohamud, 46, who taught chemistry at a university in the Somalian capital, has a daughter studying at Smith College who plans to go on to medical school and another child studying accounting at Barry University in Florida. His six other children also plan to go to college, he said.

The Somalis began arriving in this city in February 2001, beginning the ethnic transformation of a city that was 97 percent white. Somalis now represent close to 10 percent of Lewiston's population, with an additional 30 or so arriving each month. Because of the Somalis' large families, the percentage in the schools is even higher.

Jimmy Simones, owner of a restaurant near City Hall and grandson of Greek immigrants, said incidents like those involving the pig's head and the ham should not overshadow the way the city has welcomed its latest arrivals from abroad. Overall, he said, the Somalis are winning acceptance.

"All newcomers run into these bumps in the road," he said. "This is nothing different."