The invention discloses an ecological system for comprehensively treating rural rainwater and sewage in hilly areas. The ecological system is composed of an improved three-grid septic tank, an ecological pond, a water collecting well, a flow discarding device, an infiltration well, a first valve and a second valve. Rural rainwater and domestic sewage in the hilly areas are comprehensively treatedin an ecological treatment mode. The domestic sewage treatment system comprises the improved three-grid septic tank and the ecological pond, wherein the ecological pond consists of a drop-type ecological water distribution channel and a main body. A rainwater runoff treatment system comprises the water collecting well, the discarding device and the infiltration well, rainwater runoff is filtered,infiltrated and accumulated through the infiltration well to be used for supplying underground water, and an overflow part is used for guiding water to activate the ecological pond or used for agricultural irrigation and direct drainage of rivers together with effluent of the ecological pond. The ecological system is novel in structure, rainwater and sewage are collected in an unpowered self-flowing mode, rural rainwater and sewage comprehensive treatment and water resource utilization are achieved, and the system has the advantages of being free of power output, low in construction cost, convenient to operate and maintain, outstanding in economic and environmental benefits and the like.