An investigation by state and federal agencies found that McKesson overbilled for more than 1,400 brand-name drugs from 2001 to 2009.
They include commonly prescribed medications such as Adderall, Allegra, Ambien, Celexa, Lipitor, Neurontin, Prevacid, Prozac and Ritalin, officials said.
California will receive about $24 million of the settlement, said state Attorney General Kamala Harris. That money will go to the state Medicaid program, not recipients.
"In these difficult budget times, it is crucial that California's scarce public resources support the urgent needs of our state," Harris said in a statement. "We cannot allow dollars meant for patients to be diverted to inflate corporate profits."
McKesson representative Kris Fortner said the claims against the company are without merit, but "given the inherent uncertainty of litigation, we determined that this settlement was in the best interest of our employees, customers, suppliers and shareholders."
"We did not manipulate drug prices and did not violate any laws," Fortner said.
The settlement stems from a 2005 whistle-blower lawsuit that was filed under federal and states' false-claims statutes. It alleged that McKesson inflated average wholesale prices reported to First Data Bank, which many state Medicaid programs use to set payment rates for pharmaceutical reimbursement.
The federal government settled its portion of the lawsuit in April for more than $187 million.
New York will receive the largest share of the states' settlement, $36 million, according to officials with state Attorney General Eric Schneiderman's office.
"Pharmaceutical distribution companies are not above the law. This settlement holds McKesson accountable for attempting to make millions of dollars in illegal profits," Schneiderman said.
Other states covered in the settlement include Arkansas, Colorado, Florida, Georgia, Idaho, Illinois, Indiana, Iowa, Maine, Michigan, Minnesota, Nebraska, Nevada, New Hampshire, New Mexico, North Carolina, North Dakota, South Dakota, Tennessee, Texas, Vermont, Washington, West Virginia and Wyoming.