Drug maker GlaxoSmithKline PLC agreed to plead guilty to criminal charges of illegally marketing drugs and withholding safety data from U.S. regulators, and to pay $3 billion to the government in what the Justice Department called the largest health-care fraud settlement in U.S. history.

Under the deal, which requires court approval, Glaxo will plead guilty to criminal charges involving three drugs—the antidepressants Paxil and Wellbutrin and the diabetes drug Avandia. The settlement includes $1 billion in criminal fines and...