In what animal welfare advocates are describing as a “historic advance,” Burger King, the world’s second-largest hamburger chain, said yesterday that it would begin buying eggs and pork from suppliers that did not confine their animals in cages and crates.

The company said that it would also favor suppliers of chickens that use gas, or “controlled-atmospheric stunning,” rather than electric shocks to knock birds unconscious before slaughter. It is considered a more humane method, though only a handful of slaughterhouses use it.

The goal for the next few months, Burger King said is for 2 percent of its eggs to be “cage free,” and for 10 percent of its pork to come from farms that allow sows to move around inside pens, rather than being confined to crates. The company said those percentages would rise as more farmers shift to these methods and more competitively priced supplies become available.

The cage-free eggs and crate-free pork will cost more, although it is not clear how much because Burger King is still negotiating prices, Steven Grover, vice president for food safety, quality assurance and regulatory compliance, said. Prices of food at the chain’s restaurants will not be increased as a result.