Sayyiduna Ibn Abbas (may Allah be pleased with them both) says: Two men brought a dispute to the Prophet (peace and blessings be upon him). The Prophet (peace and blessings be upon him) asked the claimant for evidence. He had no evidence, so the defendant swore by Allah, and the Prophet (peace and blessings be upon him) said: "You did what you did, but because of the sincerity of 'La ilaha illallah' (There is none worthy of worship except Allah) you will be forgiven."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19876