HOUSTON — A federal judge in New Orleans on Tuesday approved an agreement between BP and the Justice Department for the company to plead guilty to 14 criminal charges and pay $4 billion in penalties for the 2010 oil well blowout and spill in the Gulf of Mexico that left 11 workers dead and fouled hundreds of miles of shoreline.

Several dozen people gave emotional testimony and submitted letters to Judge Sarah S. Vance, of Federal District Court in New Orleans, requesting that she reject the plea agreement reached last November. Some wanted additional financial compensation, while others requested stronger punishment for BP supervisors or a more powerful apology.

“If I had my wish,” wrote Ashley Manuel, daughter of Keith Blair Manuel, one of the 11 rig workers who died, “it would be that the three representatives from BP who sat in my grandparents’ living room and lied to my face about the accident would sit in jail and feel the same pain and loss I feel.”

At the hearing on Tuesday, Luke Keller, a vice president of BP America, apologized to the families. “BP understands and acknowledges its role in that tragedy, and we apologize — BP apologizes — to all those injured and especially to the families of the lost loved ones,” Mr. Keller said. “BP is also sorry for the harm to the environment that resulted from the spill, and we apologize to the individuals and communities who were injured.”