Liverani, who was appointed only in June, has paid the price for just one win in his seven games in charge, which included a Coppa Italia defeat to Serie B side Spezia. He leaves Grifone 16th in Serie A.
Reports had earlier suggested that Gasperini was in advanced talks over a return to the Stadio Luigi Ferraris, and the club have now confirmed his arrival.
"The club thanks Fabio Liverani for his work and the effort he has put in during these months," said Genoa in a statement.
Gasperini, who spent four years at Genoa before replacing Leonardo at Inter Milan in 2010, has signed a three-year contract.
The 55-year-old may have a degree of sympathy for his predecessor, as he was sacked after just five games of his stint at the San Siro, before a strange string of events unfolded at Palermo earlier this year.