Image copyright Reuters Image caption Ben Carson says Facebook is discriminating against people based on "who they are"

Facebook has been charged for allegedly allowing housing advertisers to discriminate against users based on race, sex and disability.

The US Department of Housing and Urban Development (HUD) has charged the site for violating the Fair Housing Act.

"Facebook is discriminating against people based upon who they are and where they live," HUD secretary Ben Carson said in a statement.

Facebook said it was "disappointed" by the charges.

"We're surprised by HUD's decision, as we've been working with them to address their concerns and have taken significant steps to prevent ads discrimination," a Facebook spokesperson told the BBC in an email.

The charges say the tech giant is violating the Fair Housing Act by letting house sellers and landlords use its platform to discriminate.

Facebook "has offered advertisers hundreds of thousands of attributes from which to choose", allowing them to exclude groups like "women in the workforce", "foreigners" or "Puerto Rico Islanders", or those who expressed an interest in "Hijab Fashion", "parenting" or "service animal", the document says.

It also alleges Facebook allowed advertisers to draw red lines on maps to exclude certain neighbourhoods, or to choose to show ads to only men or only women.

Image copyright AFP/Getty Image caption Facebook has faced several major scandals in recent years

The charges come after HUD filed a formal complaint against the company for alleged housing discrimination.

As it stands an administrative law judge will hear the charges, rather than a federal court. The judge could award damages if discrimination is found to have taken place.

These charges mark the latest in a series of scandals to hit Facebook.

On Wednesday, the company said it would ban "praise support and representation of white nationalism" on its platform after a man livestreamed an attack on two mosques in New Zealand.

A group of French Muslims are suing Facebook and YouTube over the footage.

In December, UK MPs accused the company of giving some developers special access to user data. Facebook said the documents were taken out of context.