Washing machine (1) comprising a chamber (10) for receiving goods to be washed; a tank (30) adapted to contain a fluid; a heat pump (20) comprising a first heat exchanger (22), a second heat exchanger (24), a compressor (26) and a pressure lowering device (28) forming a circuit comprising a refrigerant; the first heat exchanger (22) being adapted to cool said refrigerant and to heat water to be used in the chamber (10); and the second heat exchanger (24) being adapted to heat said refrigerant and to cool the fluid contained in the tank (30), wherein: