The 48-year-old took over in the 2015-2016 season, guiding Cagliari into the Italian top flight after winning Serie B in 2016.
Last season the club finished 11th but this term are trailing in 14th position with just two wins in eight games, against relegation rivals Crotone and SPAL.
“We thank Rastelli for over two years of work with professionalism and passion,” Cagliari said in a statement.
“He was a protagonist in winning Serie B and in reaching 11th place last season, and we wish him good luck for the rest of his career.”
Coaching assistants Nicola Legrottaglie and Dario Rossi were also sacked in the clearout.
Cagliari are on a run of four straight losses, the most recent a 3-2 defeat at home against Genoa.
Former Pescara coach Massimo Oddo and Giuseppe Iachini, who last season managed Palermo and Udinese, are being touted as possible replacements.