Praise be to Allah.
There is no sin on him and his fast is still valid, because Allaah says at the end of Soorat al-Baqarah (interpretation of the meaning):
“Our Lord! Punish us not if we forget or fall into error”
and it was narrated in a saheeh hadeeth from the Messenger of Allaah (peace and blessings of Allaah be upon him) that Allaah said, “Your prayer is accepted.” And it was narrated from Abu Hurayrah (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said: “Whoever forgets when he is fasting and eats or drinks, let him complete his fast, for it is Allaah Who has fed him and given him to drink.”
The same applies if he has intercourse, forgetting that he is fasting. His fast is still valid according to the more sound of the two scholarly opinions, because of the verse quoted above and because of this hadeeth, and because the Prophet (peace and blessings of Allaah be upon him) said: “Whoever breaks his fast in Ramadaan by mistake does not have to make it up or offer any expiation.”
Narrated and classed as saheeh by al-Haakim; classed as hasan by al-Albaani in Saheeh al-Jaami’, 6070. This wording includes intercourse and other things that break the fast, if the fasting person does them by mistake out of forgetfulness. This is by the mercy, generosity and kindness of Allaah, to Whom be praise and thanks.