General Motors Co.’s outside counsel will not be forced to hand over internal notes and memos related to the automaker’s deadly ignition-switch defect, a judge has ruled.

Plaintiffs lawyers requested the documents from King & Spalding, citing the crime-fraud exception. They claimed that GM used the firm to dodge federal regulators by quietly settling the cases related to the ignition-switch defects.