In law, a legal opinion is in certain jurisdictions a written explanation by a judge or group of judges that accompanies an order or ruling in a case, laying out the rationale and legal principles for the ruling.
Opinions are in those jurisdictions usually published at the direction of the court, and to the extent they contain pronouncements about what the law is and how it should be interpreted, they reinforce, change, establish, or overturn legal precedent. If court decides that an opinion should be published, the opinion may be included in a volume from a series of books called law reports (or reporters in the United States). Published opinions of courts are also collectively referred to as case law, and constitute in the common law legal systems one of the major sources of law.
Not every case decided by a higher court results in the publication of an opinion; in fact many cases do not, since an opinion is often published only when the law is being interpreted in a novel way, or the case is a high-profile matter of general public interest and the court wishes to make the details of its ruling public. In the majority of US cases, the judges issue a memorandum decision that indicates how state or federal law applies to the case and affirms or reverses the decision of the lower court. A memorandum decision does not establish legal precedent or re-interpret the law, and cannot be invoked in subsequent cases to justify a ruling. Opinions, on the other hand, always establish a particular legal interpretation.
In the United Kingdom and other common law countries, a legal opinion also refers to written legal advice on a point of law issued by either a barrister or advocate (often referred to as "counsel's opinion") or occasionally a senior government law officer, such as an attorney general. Where the opinion is given by a foreign lawyer or foreign law firm it is usually referred to as a 'foreign legal opinion'.