Unsold sandwiches and fruit and cheese boxes at Starbucks will soon be destined for somewhere besides the trash.

The coffee giant set a goal Tuesday to donate 100% of its unsold food still safe to eat from its 7,600 U.S. stores. Through partnerships with Food Donation Connection and the nonprofit Feeding America, perishable food will be picked up from Starbucks stores at the end of each day in refrigerated vans and redistributed to food banks. That includes breakfast sandwiches, paninis, salads and the company's "bistro boxes," prepackaged meals filled with snacks like vegetables and hummus, fruit and wraps.

Starbucks says the program, called FoodShare, will provide five million meals in the first year and nearly 50 million by 2021, when it expects to reach a 100% donation rate. Starbucks has already partnered with Food Donation Connection since 2010 to donate its surplus pastries. But for the expanded partnership, Starbucks had to figure out how to make sure fresh items would still be safe to eat by the time it reached needy individuals.

"The challenge was finding a way to preserve the food’s quality during delivery," said Jane Maly, brand manager on the Starbucks Food team, in a company statement. "We focused on maintaining the temperature, texture and flavor of the surplus food, so when it reached a person in need, they could safely enjoy it."

Starbucks is hoping other restaurants will get on board and that it could eventually dispatch its refrigerated vans to other chains looking to divert food waste. Feeding America estimates the country wastes 70 billion pounds of food every year. Meanwhile, millions of households are considered food insecure, defined as lacking "access to enough food for an active, healthy life for all household members," according to the U.S. Department of Agriculture, which says 17.4 million households were food insecure in 2014.

"When we thought about our vast store footprint across the U.S. and the impact we could make, it put a fire under us to figure out how to donate this food instead of throwing it away," said Jane Maly, brand manager, Starbucks Food team, in a company statement. "The challenge was finding a way to preserve the food’s quality during delivery. We focused on maintaining the temperature, texture and flavor of the surplus food, so when it reached a person in need, they could safely enjoy it."

Follow Hadley Malcolm on Twitter @hadleypdxdc.