The invention discloses a solar and biogas combined heat pump system which comprises a biogas supply system, a heat pump working medium circulation system, a solar energy utilization system and a tail gas heat recovery purification system, wherein the biogas supply system comprises a biogas digester, a biogas storage tank and a heater; the heater is arranged in the biogas digester; the heat pump working medium circulation system comprises a compressor, a condensing coil pipe, a throttling valve, an intermediate heat exchanger, a biogas internal combustion engine, a water tank, an air source heat exchanger, a four-way reversing valve, a first three-way valve and a second three-way valve; the compressor is driven by the biogas internal combustion engine; the solar energy utilization system comprises a solar energy collector, a water pump, a third three-way valve and a fourth three-way valve; the tail gas heat recovery purification system comprises the heater and a tail gas purification device. According to the system, cooling in summer, heating in winter and the supply of hot water are combined by utilizing a biogas driving mode, and the biogas digester is heated by tail gas produced by the combustion of biogas to promote the fermentation of microorganisms, so that the yield of the biogas is ensured, and the reliable and continuous running of the system is ensured.