The U.S. Supreme Court restricted the ability of companies to patent human genetic sequences, ruling in a case that tested a decades-old practice and raised questions about thousands of biotechnology, agricultural and drug patents.

The justices unanimously issued a mixed ruling on Myriad Genetics Inc.’s patents on genes linked to breast and ovarian cancer. The majority said that some parts of Myriad’s patents improperly covered natural phenomena, while other parts require enough human intervention to be eligible for legal protection.

The ruling marks an important moment for patent law, with implications for the growing field of personalized medicine and efforts to map the human brain and discover new uses for embryonic stem cells.

The decision is a partial victory for doctors’ groups and patient advocates that accused Myriad of using its patents to block clinical testing and research. Biotechnology, agriculture and drug industries backed Myriad in the case, telling the court that gene patents have led to valuable treatments.

Myriad rose $2.91, or 8.6 percent, to $36.83 at 10:35 a.m. in New York.

Genes are encoded strands of nucleotides in different sequences that are responsible for inherited traits. Myriad’s patents covered sequences in the form known as “isolated DNA,” after they have been removed from the body.

Writing for the court, Justice Clarence Thomas said isolated DNA is a “product of nature and not patent eligible merely because it has been isolated.”

At the same time, Thomas said synthetic molecules known as complementary DNA, or cDNA, can be patented because they require a significant amount of human manipulation to create. Those molecules are stripped-down versions of the genetic sequence within the body, including only the parts of the gene that can encode proteins.

The case is Association for Molecular Pathology v. Myriad Genetics, 12-398.