SAN FRANCISCO—A San Francisco judge imposed the maximum sentence allowed by law against Pacific Gas and Electric Company for violating pipeline safety standards after an natural gas explosion killed eight people, and injured dozens more in 2010.

PG&E was convicted of six felony charges and sentenced to a five-year probation period, a $3 million fine, independent safety monitoring, and 10,000 hours of community service.

“I find the crimes at issue to be very serious and to pose great risk to the public safety. Given the dismissal of allegations under the Alternative Fines Act, this is the maximum fine I’m allowed to impose by statute,” said U.S. District Judge Thelton Henderson .

Judge Henderson penalized the corporation by mandating PG&E to air 12,500 60-second commercials over a three-month period, and take out full-page ads in the San Francisco Chronicle and Wall Street Journal to publicize PG&E’s conviction. The ads must detail the nature of PG&E’s offenses and the steps the company is taking to prevent similar disasters in the future.

A 54-year-old, 30-inch pipeline under an intersection in a residential area blew-up on September 9, 2010, sending about 3,000 pounds of section from the pipe skyward and leaving a crater behind that was roughly the size of a house. The explosion destroyed 38 homes and damaged 70 others. Sixty-six people were injured, and eight people died.

Last August, a federal jury convicted PG&E on five charges of violating federal pipeline safety regulations and one charge of obstructing National Transportation Safety Board’s investigation into the explosion.

The NTSB determined the explosion was the result of a combination of flawed maintenance, subpar record keeping, and laxed oversight by the Public Utilities Commission.

Judge Henderson said PG&E should focus on giving back to the community of San Bruno, California.

Around 2,000 hours of the mandated 10,000 hours of community service must be performed by high level executives.

“We want San Bruno and all of the communities we serve to know that we at PG&E have committed ourselves to a goal of transforming this company into the safest and most reliable energy provider in America and to re-earning their trust through our actions,” said PG&E in a written statement.