Five years ago, as Prince William County police began reporting illegal immigrants to federal officials, Edilio Morales tried to lie low. The Guatemalan warehouse worker avoided hitching rides with other undocumented friends and started bicycling to church. Several times, he said, the police stopped him and asked him for identification but let him go after he took out his Bible.

About the same time, Steve Thomas was getting fed up. One house on his street was home to four immigrant families, who were running an illegal laundry and day-care center. As operations chairman of Help Save Manassas, a group that aimed to remove illegal immigrants from the area, Thomas ardently endorsed the new police mandate.

Today, Morales’s fear has abated, and so has Thomas’s frustration.

Thomas says the rental houses on his street in Manassas no longer have multiple families and neighbors have resolved their differences. “I’ve actually become pretty good friends with some of the people who were on the other side of the issue,” he said.

Morales, 44, who stopped to chat recently while browsing among guavas and chilies in a Woodbridge supermarket, no longer looks over his shoulder. “We are not afraid of the police anymore,” he said. “My family is all here, and I have a good job. I have faith that Mr. Obama will fulfill his promise so I can be legal, too.”

Prince William has changed dramatically since 2007, when officials, responding to a massive influx of poor and often undocumented Hispanics, passed an unusually tough ordinance aimed at driving them out. The action helped spur similar efforts in Arizona and Alabama, spread panic among Latinos and created emotional confrontations that tore at the fabric of this Northern Virginia county of 400,000.

Today, as Congress struggles with how to handle the nation’s 11 million illegal immigrants, Prince William’s remarkable journey offers a lesson in compromise. The county ultimately paired tougher enforcement regulations with a more inclusive and tolerant approach, a combination that in many ways reflects the current bipartisan proposal.

After a contentious trial run, the initial law was softened. Meanwhile, zoning codes were toughened, reducing overcrowding and other problems that had accompanied the immigrant wave.

Prince William has emerged as a more tolerant mosaic. The immigrant population has remained steady at about 20 percent, and the mix still includes many illegal immigrants, but some have become legal residents and U.S. citizens by now.

“At the time of the anti-immigrant bill, even U.S. citizens felt unwanted. Now the fear is leaving and people are getting back to business,” said Carlos Castro, 50, a naturalized U.S. citizen from El Salvador who owns several supermarkets in Prince William. “Despite all the suffering and anguish, our community is stronger and others are more accepting of us.”

Tension and polarization

The 2007 ordinance transformed the county into an ideological war zone, sparking boycotts and threats and emptying out entire residential streets.

Proponents of the the law said it was necessary to reduce the problems of crime, residential overcrowding and overburdened social services they said had resulted from the flow of illegal immigrants moving in due to the then-booming economy.

“It got worse and worse,” said Corey Stewart, chairman of the the Board of County Supervisors and a leading proponent of the ordinance. “We had police on the street telling us they had picked up suspects they presumed were illegal immigrants and sent to jail, and they would see them again in the community, and that was frustrating to them.”

The law called for police to question people they suspected of being in the country illegally. It also denied services to elderly, homeless, or drug-addicted illegal immigrants. In addition, the county had joined a federal program, known as 287 (G), that established formal cooperation between local law enforcement and the Immigration and Customs Enforcement agency.

Immigrants and their advocates called the ordinance unconstitutional and predicted it would lead to racial profiling. Latinos here illegally became nervous about driving, going to the hospital or even walking down the street.

Fears of deportation, combined with the nationwide economic downturn, prompted between 2,000 and 6,000 immigrants to leave, according to a later study by the University of Virginia. Legal immigrants, too, reported being asked to show proof of residency for basic services.

“This was a very polarized community, and there were unrealistic expectations on all sides,” said Charlie Deane, who was county police chief when the measure was approved.

At the height of the tensions, activists reported receiving threats. Elena Schlossberg, a mother of two who opposed the law, got intimidating e-mails. “People hated you that didn’t even know you, and wished horrible things upon you,” she recalled.

After the county board voted unanimously to fund the new police program, stunned immigrants began to pack their belongings.

Meanwhile, county police, worried that the law would overturn years of building good community relations, embarked on a public information blitz, attending community meetings and circulating brochures in Spanish that pledged not to arrest people “based on their racial appearance” and promised to protect crime victims from being deported.

Finally, in 2008, amid growing controversy over its legality, the ordinance was modified. Police were directed to question all criminal suspects about their immigration status — but only after an arrest.

“Within weeks of changing the policy,” said board member Marty Nohe, “it ceased to be the prime thing people talked about.”

No easy solutions

On a recent snowy evening in February, every chair in the Union Hispana, a financial services office in Manassas, was taken by Latinos waiting for help with their tax returns. Some were illegal immigrants, but all had arrived with pay stubs, taxpayer ID cards and a desire to solidify their place in American society.

“Our family is doing okay, but our dream is to be 100 percent legal,” said Miguel Serrano, 34, a landscaper from Guatemala. “We have three kids and a house now, but my wife does not have papers, and we always worry about what would happen if she got sent home. But now that Mr. Obama has a second term, we are praying that he can resolve our problems once and for all.”

While some illegal immigrants said they were more focused on being safe from deportation than on becoming U.S. citizens, several recently naturalized citizens expressed a newfound sense of belonging in Prince William, a former farming county that has been transformed by townhouse developments, strip malls and multi-lane parkways.

“Before, we were a meek minority with limited English. Now we are voters,” said Julio Piñeda, 42, a stocky maintenance worker who was shopping for cactus pads in a Woodbridge market while mariachi music blared overhead. Two decades ago, he was an undocumented refu­gee from El Salvador; today he is a confident American citizen who proudly declared he had voted for Obama.

As memories of Prince William’s divisive battles recede, many non-immigrants say the issue of illegal immigration has faded.

At the food court in the Potomac Mills shopping center in Woodbridge, college student Kendra Miles, 19, said that when she moved to the area five years ago, she often heard people complain about immigrants “hanging out on the streets.” Today, she said, “I think they’re just part of the culture.”

Robert Weiss, 55, who owns an equipment-repair business, was eating at a nearby table. He said he had supported the original law but now favors offering illegal immigrants a path to citizenship — as long as they don’t jump ahead of legal immigrants who have been waiting their turn.

“It can’t be an easy solution,” Weiss said, adding that it would be wrong to reward those who broke U.S. immigration laws.

Some of the concerns about illegal immigrants still linger. At a smoke-filled billiard parlor in Woodbridge, Jan Hayes, a 30-year-old restaurant cook, said he feared his job would be taken by an illegal immigrant willing to work for lower wages. “They’re kind of taking over,” he said.

But Barbara Parsels, a floral designer from Manassas, said she felt the influx of immigrant labor had played a positive role in the county’s economic progress.

“I’m all for strengthening our borders and checking ID, so I think that’s all good,” Parsels said. “But for the people who are already here and working to be able to get a way to stay? I think that’s good too.”

These days, many in Prince William look at the burgeoning national debate on immigration and recognize the arc of their own journey — the heated rhetoric, the hurt feelings, the clashes of ideology, and the eventual agreement to search for common ground.

With the softening of the original law and the reduction in social problems since then, both sides have claimed a measure of victory.

“The number of illegal aliens seems to be lower than it was,” said Greg Letiecq, who headed Help Save Manassas and was one of the law’s most vocal proponents. “Day laborer activity has decreased, and residential overcrowding . . . seems to be almost entirely abated.”

Stewart, who is currently running for Virginia lieutenant governor, said he intends to keep the issue alive in the race. Both he and Letiecq blasted moderate Republicans who have endorsed a bipartisan proposal for a path to legalization for those now here illegally.

But other county Republicans say they support the proposal. Thomas says he likes what he is hearing from U.S. Sen. Marco Rubio (Fla.) and hopes a path to citizenship can be achieved in a measured way.

“I think folks realize that you can’t keep having the same debate year after year,” he said. “The demographics are changing. . . . We’ve got to figure out a way to assimilate these folks.”

The study by the University of Virginia, commissioned by the county, found that while in 2007 and 2008 Hispanics in Prince William reported a plunge in their quality of life and their level of trust in police, these measures have since bounced back. Levels for other groups remained relatively steady. The study noted that immigrants make up only a small percentage of those arrested for serious crimes.

Police officials in Prince William argue that it was outreach and empathy, not force and fear, that enabled them to weed out serious lawbreakers without losing the confidence of most Latinos. (The department ended its affiliation with the federal ICE program last year.)

“We tried to calm these fears and explain exactly what we would and would not do,” Deane said. “As a result, we were able to regain the Hispanic community’s trust and build respect on both sides.”

Thomas, who also chairs the City of Manassas Republican Committee, said that as the conversation has moved on to the national arena, “I think that folks on my side of the debate are a little bit more open . . . The citizens that were involved on the other side, they’re our neighbors. They’re not bad people, they just disagree.”

Schlossberg, the activist who once received threatening e-mails, said she hopes the lessons of her community will be reflected on the national stage.

“I think what you see is the country going the way of Prince William County, where things got really heated, and I think even the people who believed immigration should be dealt with started getting uncomfortable with all the rhetoric,” she said.

“There is a sense that we engaged in a nasty debate, and sanity won.”