An appeals court in New Jersey on Friday threw out the conviction of the former roommate of Tyler Clementi, the Rutgers University freshman who killed himself six years ago after he was spied on while having sex with another man.

The Appellate Division of the Superior Court of New Jersey in Newark overturned a lower court’s conviction of the ex-roommate, Dharun Ravi, on several counts of bias intimidation because of a change in state law. The court called for a new trial of Mr. Ravi on 10 other counts that included invasion of privacy and tampering with evidence.

Mr. Ravi was convicted in 2012 in a case that drew international attention to the bullying of gay teenagers after Mr. Clementi jumped to his death from the George Washington Bridge. Mr. Clementi’s life and death were taken up by advocates for lesbian, gay, bisexual and transgender rights, and the case delved into the risks that are sometimes associated with coming out as Mr. Clementi had struggled with questions about his sexuality.

Mr. Clementi’s suicide at age 18 came just days after he learned that Mr. Ravi had used a webcam to spy on him and had used social media to invite others to watch a sexual encounter in the dormitory room Mr. Clementi shared with Mr. Ravi.