President Obama signed into law Wednesday sweeping new power for the Environmental Protection Agency to regulate thousands of toxic substances found in everyday products from household cleaners to toys and furniture.

It marks the first major overhaul of the toxic substance law since it was originally passed 40 years ago and an unexpected bipartisan achievement in an election year.

The law sets safety standards for a host of toxic substances, including asbestos, formaldehyde and Bisphenol A, commonly known as BPA.

The EPA also will be able to evaluate chemicals against a new, risk-based safety standard that places special consideration on the risk to vulnerable people such as children and pregnant women.

The new law does have detractors.

Some environmental groups said it doesn’t give the EPA enough new power. Some conservatives said it gives the federal regulators too much new power over the states.

But businesses mostly backed the law and supported federal standards to replace a hodgepodge of state regulations.

“This is a big deal. This is a good law. It’s an important law,” Mr. Obama said at a bill-signing ceremony at the White House. “Here in America, folks should have the confidence to know the laundry detergent we buy isn’t going to make us sick, [or] the mattress that our babies sleep on aren’t going to harm them.”

The president was joined on stage by more than a dozen lawmakers from both parties.

“I want the American people to know that this is proof that even in the current polarized political climate here in Washington, things can work — it’s possible,” he said. “If we can get this bill done it means that somewhere out there on the horizon, we can make our politics less toxic as well.”

The Frank R. Lautenberg Chemical Safety for the 21st Century Act was named for the late New Jersey Democrat who spent years trying to fix the toxic-substance law before his death in 2013.

Sen. Tom Udall who spearheaded passage of the legislation said the president’s signature marked “a historic step forward that will improve the health and safety of every American family.”

“This isn’t the last step,” he said. “We must ensure the new program is a success. And as the lead Democrat on the Appropriations subcommittee that oversees the EPA’s budget, I’m putting the EPA and the industry on notice: I will be watching.”

Cal Dooley, president and CEO of the American Chemistry Council, a top trade association for chemical manufacturers, called the new law “a historic bipartisan achievement at a time when such achievements are increasingly rare.”

“Under it, chemical evaluation and regulation will meet new 21st century standards, which will improve the lives of American families, support American manufacturing and bolster U.S. economic growth,” he said.

The CAA has been pushing for reform of the toxic substance law since 2008.

John B. Morris, president of the Society of Toxicology, also applauded the law, saying it “contains strong, objective, scientific underpinnings and will protect public health for years to come.”

“We are heartened to see the inclusion of sound toxicological principles and risk concepts, including an emphasis on exposure as well as hazard, in the bill,” he said.

In a statement announcing Mr. Obama’s intention to sign the legislation, the White House said it was not a perfect bill, but “meets the high goals set by the administration for meaningful reform.”