The invention provides an efficient system for treating livestock waste, particularly waste from cattle or pig farming. The new facility and method employ special transfers of slurry streams through ASBR, SBR, and a unique pretreatment reactor, resulting in treated water, quality compost, and biogas.