The Viola started the match on the front foot and Josip Ilicic almost gave them the lead when his initial strike was saved, before his attempt from the rebound was blocked on the line by Gabriele Perico.
© Getty Images
Ilicic stepped up to take the resulting spot kick and beat Agliardi with a composed finish into the corner.
The Viola then doubled their lead four minutes later when Ilicic collected the ball just inside the box before drilling a low strike into the far corner.
Mohamed Salah then curled an effort wide, before forcing the keeper to push behind a powerful strike, as Fiorentina threatened a third before the break.
At the start of the second half, Salah came close again with a low shot that was turned to safety by the keeper.
It proved to be only a consolation, as Fiorentina held on to move back into the top five in the Serie A table.