Former Genoa boss Malesani became Palermo's third coach of the season when Gasperini was dismissed on February 4 but, with the Sicilians still rooted to the bottom of the table, Rosanero president Maurizio Zamparini has changed his mind.
A statement published on palermocalcio.it read: "Palermo can confirm they have relieved Alberto Malesani of his duties and reappointed Gian Piero Gasperini.
"There is considerable regret because Alberto Malesani is a fine person and a great coach.
"We thank him for all the work he has done. The decision that has been taken seemed the only viable one at this difficult time."
Gasperini's first stint at the Renzo Barbera began in September when Giuseppe Sannino, expensively recruited from Siena in the summer, was fired after picking up just one point from his three games in charge.
Three wins from 20 league games under Gasperini left Palermo in 19th place, however, and the 55-year-old was replaced by Malesani following a 2-1 home defeat to Atalanta.
A UEFA Cup-winning manager with Parma, Malesani could only navigate uninspiring draws against Pescara, Chievo and Genoa as Palermo slumped to the bottom of the standings and towards a return to Serie B after nine seasons in the top flight.
Gasperini, who brought 10 new players to the club in January, has 12 games left to overturn six-point deficit, with a trip to Torino next Sunday the first appointment of his second spell in charge.
Palermo, however, must still play eight of the teams currently in the top half of Serie A table, including league leaders Juventus, AC Milan, Inter Milan and Fiorentina.