Harassing someone of the same sex isn't illegal under federal discrimination law covering sexual harassment, a federal judge ruled.

The federal Civil Rights Act of 1964 doesn't cover a person claiming to have been the "victim of sexual harassment by a supervisor or co-worker of the same gender," U.S. District Court Judge Alexander Harvey II ruled Wednesday.Harvey dismissed a suit filed by David Hopkins, a former employee of Baltimore Gas and Electric Co. who claimed his male supervisor, Ira Swadow, made unwelcome advances. Hopkins said Swadow pointed a magnifying lens at his groin and questioned him about his sexual activities, among other incidents.

Both were laid off as part of restructuring last year.

Harvey wrote that Hopkins may have been justifiably offended by his supervisor's remarks but did not have a harassment case under existing federal law. He noted that the supervisor allegedly harassed men and women equally, according to testimony.

Hopkins said he would appeal the ruling. Swadow has denied he made the remarks.

Federal courts in other states have ruled that Title VII of the Civil Rights Act, which prohibits discrimination on the basis of sex, covers same-sex harassment cases. But other judges have followed Harvey's reasoning.

Though the ruling is not precedent setting it could influence judges ruling on similar cases, said Jay Fries, a employment law expert who represents Baltimore-area employers.