The arrival of thousands of Somali refugees in this former mill city in the nation's whitest state sparked a backlash at first, complete with a rally of white supremacists and a pig's head rolled into the local mosque.

Fifteen years later, the Somali newcomers are solid members of the community, as evidenced by its proliferation of shops, restaurants and mosques -- and a championship-winning high school soccer team featuring players from Somalia and other African countries.

Shukri Abasheikh, owner of Mogadishu Store, a general store that caters to the African community, said she and her fellow newcomers have won respect from residents through hard work.

'We need peace'

"When Somalis came in, Lewiston people, Maine people, they think we need welfare, but we don't need welfare. We need jobs. We need peace. We need education," said Abasheikh, who worked as a janitor before achieving her dream of running her own business.

Students walk home from school in Lewiston, Maine, Jan. 26, 2016. Since February 2000, more than 5,000 Africans have come to Lewiston, a city of 36,500.

As the U.S. prepares to accept thousands of refugees from war-torn Syria in coming months and years, this riverside community illuminates the challenges such newcomers can face -- and shows that integration can be slow and painful, but ultimately successful.

Since February 2001, more than 5,000 Africans have come to Lewiston, a city of 36,500 on the Androscoggin River, in a prime example of what scholars call "rapid ethnic diversification."

The first Somalis found Lewiston after a refugee resettlement program was established in Portland, Maine's largest city.

Because of a housing shortage in Portland, they looked 30 miles to the north, where aging apartments that once housed Lewiston's mill workers provided plenty of low-cost homes. Despite the bitter winters, Somalis saw a safe place with good schools that was walkable and not too big.

There was no formal plan. It just happened.

When refugees arrived

At first, Lewiston residents didn't know what to make of these newcomers who spoke no English, providing a challenge for schools. Many knew little of Somalia beyond news coverage of a soldier from a nearby town who was killed in a Somali firefight that became the basis for the movie "Black Hawk Down."

Some locals resented so many black Muslims moving to a Roman Catholic community where the twin spires of the Basilica of Saints Peter and Paul dominate the skyline. Rumors spread that the newcomers were getting perks like better housing and even free cars.

Mike McGraw teaches a biology class at Lewiston High School in Lewiston, Maine, Jan. 26, 2016. He is also the coach of the varsity soccer team whose undefeated team featured players from Somalia, Kenya and Congo.

Then came a letter from the mayor to the Somali community in 2002, asking them to discourage their friends and family from moving to Lewiston, saying "our city is maxed-out financially, physically and emotionally."

An out-of-state white supremacist group seized upon the discord to hold a rally.

Turning point

Residents were bewildered to find their community painted as racist in the national news, and that low point became a turning point. They began to embrace the Somali community, and thousands staged a support rally far larger than the handful of people with the white supremacists.

"That was definitely eye-opening, to see that they support and accept us," said Abdirahman Mohamud, Abasheikh's son, who grew up in Lewiston.

Three years after the rally, when someone rolled the pig's head into the mosque, swift condemnations followed. The governor at the time visited Lewiston to denounce the act, and police quickly charged the perpetrator.

Today, the smell of deep-fried samboosa fills a store in Lisbon Street, and the aroma of basmati rice and goat meat emanates from another. Shops feature colorful clothing and African staples like fufu flour.

Somalis have taken jobs with L.L. Bean, Maine's iconic outdoors retailer, and other local employers. Refugees and asylum seekers will account for about half of the city's general assistance spending in the coming year, but overall spending is the same as it was in 1990, said Deputy City Administrator Phil Nadeau.

The success flies in the face of a wave of anti-immigration sentiment nationwide that's fueled by concerns over recruitment by Muslim extremists, something that could cause problems for Syrian refugees, said Westy Egmont, director of the Immigrant Integration Lab at the Boston College School of Social Work.

Immigration opponents include Republican presidential candidate Donald Trump, who wants to ban Muslims, and several governors who have rejected the president's call to accept Syrian refugees.

"Syrians, like all newcomer groups, will face both a warm welcome and serious opposition," Egmont said, "depending on where they end up being placed."

In Lewiston, white residents now see the black newcomers want the same things they do -- a safe place to raise a family, good schools, freedom and jobs, said Abdi Said, a refugee who was originally put in San Jose, California, before he moved to Lewiston.

"We are working hard, and we're going to school and everything -- like regular American people," said Said, who hopes to buy a home for his family. "They see that we are not different."

Longtime residents have largely accepted the immigrants, said Jimmy Simones, whose grandfather was a Greek immigrant who opened Simones' Hot Dog Stand, an eatery that's now a regular stop for politicians and city leaders.

"They became a part of our community," he said. "We move on."

The Northeast U.S. state of Maine.

​The signs of acceptance are apparent at Lewiston High School, where newcomers from soccer-loving countries helped elevate the already-good team to the state championship in November.

Coach Mike McGraw, whose undefeated soccer team featured players from Somalia, Kenya and Congo, said he likes that the Muslim players often stop to pray before a game.

"It doesn't take long for kids to become Americanized," he said. "What I'm happy about my kids is that they have not lost touch with their culture."

The players don't like to talk about immigration or politics. Their success is simply an example of teamwork, said Abdi Shariff, a co-captain who lived in a Kenyan refugee camp before his family relocated to Louisville, Kentucky, and then Lewiston.

"It just shows," he said, "that people from different races, different cultures, can all work together and accomplish a goal if they want to."