AUGUSTA — Gov. Paul LePage says the state has paid nearly $700,000 in legal fees in a court case that shot down a Maine law restricting drug manufacturers’ use of information about the drugs doctors prescribe.

IMS Health Inc. sued the state of Vermont over a law requiring it to get doctors’ permission before selling data on their prescription-writing habits to drug companies, which use the information to tailor drug sales pitches.

In a 6-3 decision, the U.S. Supreme Court last year ruled that Vermont’s law was unconstitutional, thereby making a similar Maine law enacted in 2007 unconstitutional as well.

According to the conservative wing of the court — joined by Justice Sonia Sotomayor — the law violated the speech rights of the data-mining and pharmaceutical companies, the conservative wing of the court said.

Justice Stephen Breyer, arguing for the court’s more liberal wing, said the law should have been upheld as a constitutional regulation of business activity, and that it protected patients’ rights.

LePage says a federal judge last month ordered Maine to pay $678,000 in IMS Health’s legal fees related to the case.

Vermont earlier this year was ordered to pay $2.4 million in legal fees in the case.