After the Sept. 11 attacks, the World Trade Center site lay in ruins, the financial district around it languishing in dust and debris. Slowly, over the years, residential buildings, businesses and restaurants were rebuilt — or built anew — with the encouragement of city officials.

Now, the population has more than tripled, and residents find themselves trying to balance their everyday lives with the security the city says is needed for an area that could attract possible attackers. It’s also home to a major tourist attraction, the 9/11 memorial.

Residents asked a judge Thursday to stop a massive barrier system that would ring the 16-acre trade center site as part of what they call the “fortress-like” security planned for their neighborhood. The $40 million plan that also includes guard booths and gates would block them in, they say in a lawsuit against the city, the NYPD and the Port Authority of New York and New Jersey, which runs the trade center.

“We didn’t sign up to live in a gated community, with credentials needed to go home,” says Mary Perillo, a lead plaintiff in the lawsuit who’s lived for years in a 12-story brownstone dating to the 1800s.

The renewal of the World Trade Center neighborhood spans a dozen years of efforts by the administration of former Mayor Michael Bloomberg to infuse lower Manhattan with new life and developer money after the attacks drove thousands of people out.

In the 1.5-square-mile area that includes both Wall Street and the trade center, the residential population has more than tripled since 2000 to roughly 65,000, said Catherine Hughes, chairwoman of the area’s community board.

And lawyers for the community groups, who brought illustrations of the plan to Thursday’s hearing, say the security system goes too far in disrupting neighborhood life. They worry it will choke off the local community, that shops will dry up and home values will plummet amid major traffic jams and limited access.

“The checkpoints would create congestion in the narrow streets here, and pollution from tourist buses,” said Deborah Petti, who moved in 2012 into the building where Perillo also lives, a block from the trade center site.

But the tourist attractions are exactly what makes the security plans necessary, city attorney Amy McCamphill argued Thursday. The new trade center includes a world-class transit hub, as well as the Sept. 11 memorial and rising skyscrapers peaking in 1 World Trade Center, replacing the fallen twin towers.

“This is the plan for public safety for one of the most sensitive sites in the country,” McCamphill said, adding that the system will make a minimal footprint in the area. The police department stands by the security plan, as does the city.

Residents’ attorney Albert K. Butzel acknowledged his clients “know what terrorism means because they were exposed directly to it, they know and accept there has to be some type of security.”

Only several hundred people live in buildings that fall within the barriers. The restaurants and hotels within the area have been operating smoothly for years in proximity of existing heavy security.

State Supreme Court Justice Margaret Chan said she wants to visit the site before making any decision.

Construction of the security system will take years to complete. According to the NYPD, it could include static barriers, plus sally ports — booths controlling two operable barriers where each vehicle is screened for possible materials that could be used in a terrorist attack.

McCamphill said there will still be pedestrian and cyclist access, with only vehicles barred. Foot posts and barriers are to be 3 feet high, so they won’t be eyesores, she said.

But the neighborhood is growing too much for the security system not to impede neighborhood life, said Perillo, a member of the World Trade Center Neighborhood Alliance organized to try to stop the barriers.

Before the attacks, “I saw nothing but office buildings at night,” she said. “Now I see curtains, lamps, kitchens, people coming home with groceries. And more are moving in.”