Landlords’ adverts which specify that only gay people, or people from a particular racial group or gender, should apply to rent a room in their home may be illegal, a BBC investigation suggests.

The report said that while the law was untested in this area, landlords seeking lodgers for spare rooms which discriminate on the grounds of sexuality, race or other characteristics protected by the Equality Act could be illegal.

The Equality Act’s explanatory notes say landlords should not “discriminate against or victimise someone” in the process of letting a property on the grounds of a protected characteristic.

Religion, race, age, marital status, physical ability and sexual orientation are all protected under the act.

Adverts specifically requesting gay or straight room-mates may be illegal, along with adverts specifying which gender the landlord would like to live with.

An Equality and Human Rights Commission spokeswoman confirmed it wrote to lettings agents to explain that “usually they cannot specify that a prospective tenant is British, Asian or otherwise.”

The EHRC added: “Women-only ads may be against the law unless it can be objectively justified.”

In principle, therefore, there was nothing stopping gay- or straight-only adverts being illegal.

Chris Norris, head of policy at the National Landlords Association, told the BBC the situation may be different for tenants advertising for new housemates than it is for landlords renting out their own properties.

He said: “Tenants looking for new housemates should focus on describing the house’s current occupants so that potential applicants can judge for themselves whether they would be a suitable fit or not.”