Wastewater with fats, oil and grease and/or solids such as proteins and starch, can effectively be treated in the BIOPAQ®AFR. This anaerobic flotation reactor (AFR), with an effective sludge retention system, is an all-in-one system that converts organic compounds into valuable biogas. Wastewater from the food industry is especially suitable. The compactly designed bioreactor treats wastewater with a COD content from 5-70 g/l with vegetable or animal fats at hydraulically short retention times from 1-8 days. It considerably reduces discharge costs, produces valuable biogas, requires no acidification or solids separation up front.