It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) went to a grave and supplicated for forgiveness for the one in it.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 9272