The victory has all but ensured promotion for Leicester and at the same time comdemned Hereford to League 2 football next season.
"To concede a penalty and go a goal down was very frustrating," said Pearson. "But sometimes quality wins you the game and Matt's goal from the free-kick for the equaliser was fabulous.
"The two goals after that we worked very hard for and we showed some quality for those.
"In the end it looked a fairly comfortable win but it was harder than that, they had a 10-minute spell in the second half when they looked the stronger side. We had spells when we weren't at our best but it was important to get the right result."
Steve Guinan gave Hereford the lead from the penalty sport but 6 mins later Matt Oakley had levelled for the visitors.
In the second half Lloyd Dyer gave Leicester the lead with Steve Howard making sure 4 mins from time.