New York (AFP) - Disgraced TV legend Bill Cosby -- battling back in a sex assault case against him -- can sue an accuser over tweets she wrote and an interview she gave for breaching confidentiality, a judge has ruled.

In the mixed ruling issued Friday, US District Judge Eduardo Robreno also ruled that Cosby cannot sue Andrea Constand for talking to law enforcement.

Constand, who worked for the Temple University basketball team and now lives in Canada, says Cosby sexually assaulted her after plying her with pills at his Philadelphia home.

Cosby's defense team claimed that Constand breached the confidentiality provision of a settlement agreement reached a decade ago by discussing the case in a 2015 interview she did with the Toronto Sun in 2015 and Twitter posts from 2014.

Robreno's ruling was a rare piece of good news for the entertainer's team.

"We are, of course, very pleased with the court's ruling in favor of our client," Cosby's attorneys said in a statement Monday.

Cosby, 79, has become a pariah since an avalanche of women accused him of feeding them pills to have sex with them over four decades.

More than 50 women have publicly alleged sexual abuse at the hands of the former megastar, who attained his greatest fame for his role as a lovable obstetrician and family man in the hit 1980s sitcom "The Cosby Show."

A judge ruled in May that Constand's 2004 allegations could proceed to trial -- the only criminal assault charge brought against him.

The former star posted $1 million bail in the case in December, but has yet to enter a plea and a trial date has not been set thus far.