Around 100 people, most of them pastry chefs, pulled together the 4.2-tonne mille-feuille pastry, breaking a record set in Belgium 20 years ago by nearly 200 metres, ATS said.
After scrutinizing each centimetre of the flaky, layered cake to ensure it was held together as a single block, Guinness judge Anna Orford declared the new record, to cheers from around 2,000 onlookers gathered at the Palexpo centre in Geneva.
The pastry was officially measured at 1,221.6 metres long.
A total of 250 people had helped prepare the feat over the past six months, according to Gilles Desplanches, who initiated the project to celebrate the 25th anniversary of his pastry shop.
The giant pastry, consisting of 864 litres (228 gallons) of cream, 576 litres of milk, 600 kilograms (1,323 pounds) of flour, 432 kilograms of butter and 360 kilograms of chocolate fondant, will be sliced into 30,000 pieces and sold.
The expected 100,000-Swiss franc ($105,000) proceeds will go to an organization combating breast cancer, ATS reported.