By Lisa Baertlein and Sruthi Ramakrishnan

(Reuters) - McDonald's Corp's 16,000 U.S. and Canadian restaurants will serve only eggs laid by cage-free chickens within 10 years, the company said on Wednesday.

McDonald's USA has been buying more than 13 million cage-free eggs annually since 2011. The long-awaited switch is happening as North American egg suppliers are slowly starting to rebuild flocks after the worst bird flu outbreak in U.S. history.

The move comes as McDonald's, the world's biggest restaurant chain, is preparing to serve breakfast all day at U.S. outlets in October. McDonald's USA, which is fighting sagging sales, made waves in March by announcing a two-year plan to phase out meat from chickens raised with antibiotics used to fight human infections.

McDonald's buys about 2 billion eggs annually for its U.S. restaurants and 120 million for Canada to serve breakfast items such as Egg McMuffin and Egg White Delight.

Fast-food rival Burger King already has committed to using only cage-free eggs by 2017. Other large companies such as Starbucks Corp, General Mills Inc, Nestle, Sodexo Inc and Aramark [ARMRKA.UL] also are in the process of switching.

Groups such as the Humane Society of the United States (HSUS), Mercy for Animals and World Animal Protection have successfully lobbied many companies to adopt animal welfare practices. Such groups also have won commitments from nearly 100 major companies to phase out so-called gestation crates, which are small cages for breeding sows.

Celebrities such as film star Ryan Gosling have teamed up with HSUS to pressure Costco Wholesale Corp to eliminate cage-confined chickens from the company's egg supply chain. HSUS said Costco has committed to going cage free, but has not set a timeline for its full transition. HSUS said Costco rival Wal-Mart Stores Inc also has not set a timeline.

U.S. companies, led by burrito seller Chipotle Mexican Grill Inc and other popular brands, increasingly are sourcing their ingredients from suppliers who vow to use humane and environmentally sustainable agricultural practices.

Story continues

California voters in 2008 passed a law mandating that all eggs sold in the state come from chickens given more spacious living quarters. That law went into effect on Jan. 1 and other states and countries since have followed Calfornia's lead.

So far this year, the price of a dozen eggs has averaged 67 cents more in California than in the Midwest, said Brian Moscogiuri, market reporter for shell eggs and egg products at Urner Barry.

(Reporting by Sruthi Ramakrishnan in Bengaluru and Lisa Baertlein in Los Angeles; Editing by Richard Chang)