Scientists have invented a spray that keeps bananas fresh for up to two weeks and stops them from spoiling and turning into brown, soggy mush.

Store-bought bananas often go brown and soggy in just two or three days, but scientists presenting at the 244th National Meeting & Exposition of the American Chemical Society in Philadelphia say that the new spray, made from shrimp and crab shells, could stall the ripening of those 6.4 billion pounds of bananas that people in the U.S. eat every year.

Dr. Xihong Li, who made the "hydrogel" spray from chitosan, a substance derived from the shells of crustaceans or shellfish, found that spraying chitosan aerogel on unripe green bananas kept bananas fresh for up to 12 days.

"Once bananas begin to mature, they quickly become yellow and soft, and then they rot. We have developed a way to keep bananas green for a longer time and inhibit the rapid ripening that occurs. Such a coating could be used at home by consumers, in supermarkets or during shipment of bananas," Li said in a statement.

Researchers at Tianjin University of Science and Technology in China who developed the clear spray say that it is completely safe.

Researchers said that chitosan keeps fruits and vegetables fresh by killing bacteria that cause produce to rot, and the current study is the first to show that the substance can also be used to slow the ripening of bananas.

The team explained that bananas breathe through their skin by taking in oxygen and giving off carbon dioxide, and the faster they breathe, the quicker they ripen and soften, leading the bacteria on the skin to thrive and the banana to rot.

Chinese researchers noted that the spray still has to be refined to make it suitable for commercial use.

Bananas are usually transported while still green and ripened in warm humid conditions similar to those they have experienced naturally.

Bananas begin to ripen when exposed to the gas ethylene, a chemical that bananas also produce on its own, which is why they ripen quicker when kept in a bag because the gas builds up.