U.S. District Judge Sarah Vance also heard testimony from relatives of 11 workers who died when BP's blown-out Macondo well triggered an explosion on the Deepwater Horizon drilling rig and started the spill.
BP agreed in November to plead guilty to charges involving the workers' deaths and for lying to Congress about the size of the spill from its broken well, which spewed more than 200 million gallons of oil. Much of it ended up in the Gulf and soiled the shorelines of several states. The company could have withdrawn from the agreement if Vance had rejected it.
Neither the Justice Department nor BP presented arguments to the judge before her decision in New Orleans.
The deal doesn't resolve the federal government's civil claims against BP. The company could pay billions more in penalties for environmental damage.
BP separately agreed to a settlement with lawyers for Gulf Coast residents and businesses who claim the spill cost them money. BP estimates the deal with private attorneys will cost the company roughly $7.8 billion.
For the criminal settlement, BP agreed to pay nearly $1.3 billion in fines. The largest previous corporate criminal penalty assessed by the Justice Department was a $1.2 billion fine against drug maker Pfizer in 2009.
The criminal settlement also includes payments of nearly $2.4 billion to the National Fish and Wildlife Foundation and $350 million to the National Academy of Sciences.
In a court filing before the hearing, attorneys for BP and the Justice Department argued that the plea agreement imposes "severe corporate punishment" and will deter BP and other deep-water drilling companies from allowing another disaster to occur.
The Justice Department has reached a separate settlement with rig owner Transocean Ltd. that resolves the government's civil and criminal claims over the Swiss-based company's role in the disaster.
Transocean agreed to plead guilty to a misdemeanor charge of violating the Clean Water Act and pay $1.4 billion in civil and criminal penalties. U.S. District Judge Jane Triche Milazzo has scheduled a Feb. 14 hearing to decide whether to accept that criminal settlement. A different judge will decide whether to accept Transocean's civil settlement.
Many relatives of rig workers who died in the blast submitted written statements that were critical of BP's deal. Twenty-eight-year-old Gordon Jones' family members said BP's sentence should include a personal, face-to-face apology to his widow and children by BP executives. A brother of Jones also had urged Vance to consider stiffer penalties that prohibit or limit the company's ability to operate in U.S. waters.
Vance, however, said she couldn't get involved in plea negotiations and only could impose a sentence that adheres to the agreed-upon terms if she accepted it.
Also killed were Jason Anderson, 35, of Midfield, Texas; Aaron Dale "Bubba" Burkeen, 37, of Philadelphia, Miss.; Donald Clark, 49, of Newellton, La.; Stephen Ray Curtis, 40, of Georgetown, La.; Roy Wyatt Kemp, 27, Jonesville, La.; Karl Kleppinger Jr., 38, of Natchez, Miss.; Keith Blair Manuel, 56, of Gonzales, La.; Dewey A. Revette, 48, of State Line, Miss.; Shane M. Roshto, 22, of Liberty, Miss.; and Adam Weise, 24, Yorktown, Texas.
Four current or former BP employees have been indicted on separate criminal charges. BP rig supervisors Robert Kaluza and Donald Vidrine are charged with manslaughter, accused of repeatedly disregarding abnormal high-pressure readings that should have been glaring indications of trouble just before the blowout.
David Rainey, BP's former vice president of exploration for the Gulf of Mexico, was charged with withholding information from Congress about the amount of oil that was gushing from the well.
Former BP engineer Kurt Mix was charged with deleting text messages about the company's spill response.
A series of government investigations have blamed the April 20, 2010, blowout on time-saving, cost-cutting decisions by BP and its partners on the drilling project.