Mr Hughes told his father: "I did it dad. I must tell somebody," Mr Gerald Elias QC, told a jury at Chester Crown Court.
He made the confession to his father when he was in custody, on 3 August, four days after the Saturday morning on which Sophie was abducted, raped and strangled and her body was dumped in the sea at Llandudno, the jury was told.
In the past, Mr Hughes had boasted to friends of his liking for young girls, Mr Elias said, and on the day before Sophie's death had tried to abduct another child of about the same age.
"He was bent on taking and using a young girl for his own sexual purposes. It was a fantasy of his which, horrifically, he was to bring to reality.
"He had boasted to a friend in the past of his liking for girls of four or five and his wish to abduct, sexually assault and murder a young girl."
Mr Hughes, 31, of Colwyn Bay, North Wales, denies murdering Sophie, and two charges of raping her, on 30 July last year.
Mr Elias said Mr Hughes had told his father: "On Saturday afternoon I went into the back garden. I went back at about two in the morning. I persuaded a girl to go with me down to the beach.
"Dad, I have been sexually frustrated since 1990. The girl started to scream and I put my hand over her mouth and kept it there until she stopped. I took all her clothes off and threw her body into the sea."
Mr Hughes allegedly went on to describe to his father where he hid Sophie's clothes, which were later found in a bush beside a lane along which Mr Hughes would have travelled on his way back from Llandudno.
Mr Elias said Sophie, who lived in Cheshire with her parents, two sisters and brother, was taken from the tent in the back garden of her uncle's home in Llandudno as she slept in a tent with her sister and a cousin after the "end of a perfect day" of family celebration.
"She was taken from the garden and subjected to the most appallingly violent physical and sexual assaults. She was then manually strangled and her body thrown into the nearby sea," Mr Elias said.
The "depth of depravity" with which the crimes were committed "almost defies belief", he continued, adding that she was probably dead when her body was dumped in the sea. "She was 4ft 1in and weighed 28kg, 62lb - a seven-year-old helpless in the face of an attack of this savagery," Mr Elias said.
"Unhappily the assaults on her - both physical and sexual - would have taken place when she was alive, although her state of consciousness can only be guessed at."
The case continues today.Reuse content