The Department of Justice on Friday formally opposed an effort by Facebook to dismiss a lawsuit by several housing groups, arguing that the social media platform may be held legally responsible if advertisers violate fair-housing laws by using its ad-targeting tools.

The DOJ statement boosts the claims by several fair housing groups that have alleged that Facebook’s advertising tools allow landlords to block offerings to legally protected categories of potential renters, including women with children. The statement also raises questions about the reach of a key federal law, the Communications Decency Act, which has long been interpreted as offering technology companies broad immunity against legal claims related to the content that appears on their platforms.

Facebook last month sought to dismiss the claims by the housing groups, led by the National Fair Housing Alliance, on the grounds that it is “merely an interactive computer service,” according to the government’s filing Friday. But Geoffrey S. Berman, the U.S. Attorney for the Southern District of New York, sided with the plaintiffs, noting that Facebook “creates and harvests user data to develop profiles for each user, categorizing them into groups based on demographics, interests, behaviors and other criteria.”

Berman wrote, “The Complaint sufficiently alleges that, for purposes of housing advertisements, the categorizing of Facebook users based on protected characteristics, and the mechanism that Facebook offers advertisers to target those segments of the potential audience, violated the FHA.”

Facebook didn’t immediately respond to a request for comment.

The Department of Justice did not take a position on the merits of the legal claim overall, only about the applicability of the Communications Decency Act.

Berman’s filing, called a Statement of Interest, also says that the Department of Housing and Urban Development on Tuesday served an administrative complaint against Facebook “for conduct similar to that alleged” by the housing groups.

After a ProPublica investigation two years ago, Facebook said it would no longer let advertisers target ads for housing, credit offers and employment by “ethnic affinities,” a category that the social network had created to enable businesses to reach minority groups.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.