Fan runs continuously even without turning ignition key

Question

The fan in the engine compartment of my 2007 Mercedes 220 cdi runs continuously even after switching the engine off. It only stops when the battery is disconnected. Please help.