The youngster, who was seven at the time, made the admission in an interview with a police officer and a social worker last March, two days after the two-and-a-half-year-old died at a house in Fife.
Jurors at the High Court in Livingston watched video of the witness –who can’t be named for legal reasons – demonstrating how he put one hand over the boy’s mouth.
However, he also told the murder trial that when he took his hand away Liam was “sitting up”.
When asked what had happened, he at first told them: “I don’t want to tell anyone. It’s a long story. I don’t want to talk about it.”
He later added: “I don’t know anything about Liam.”
When he was asked about coming to the police station after the toddler’s death, he said he had felt “sad”. After being repeatedly reassured by the adults that he was not in any trouble, he later told them that on the night in question he had been “bad”.
The social worker asked: “What did you do that was bad?”
“I strangled Liam,” the boy replied.
Asked how he did that, the boy could be seen putting his hand to his face, over his mouth, before telling the interviewers he had used just one hand.
When asked how long he had done this for, the boy replied “a minute”.
He was asked: “What did Liam do when you were doing that?”
“Nothing” the boy replied.
“What happened when you took your hand away?” the social worker said.
“He was sitting up,” the boy said. He told the adults that he had been watching a film called the Green Lantern, and that Liam was “looking around”, adding “at the telly”.
Liam’s mum Rachel Fee, 28, and her civil partner Nyomi Fee, 32, are accused of murdering the toddler and attempting to defeat the ends of justice by blaming the boy, who was then seven years old.
They also face a catalogue of charges alleging they wilfully neglected Liam, the youngster they allegedly blame for the killing and another boy who cannot be named for legal reasons.
The jury has been told that Liam died from a severe blow to the abdomen which forced blood up into his heart causing it to rupture.
During the interview at Roxburgh Road social work office in Glenrothes two days later, the youngster said he and the other boy had played with Liam in a bedroom after having their dinner.
He said Liam, who fed himself soup and bread in his high chair while they ate on the floor, was then picked up by “Auntie Ny” (Nyomi Fee) and taken through to his bedroom.
The jury heard him say: “Auntie Ny came in and said it was time for Liam’s nap, that it was bedtime. He was half awake but then he was closing his eyes when she was carrying him. When she put Liam in his bed. He’d fallen asleep.”
Asked what Liam was wearing he answered: “His jammies. Ny put them on in his room before dinner.”
Asked what happened next, he told the interviewers: “I get into the police car and come here.”
“Who phoned the police?” the police officer asked. “Nobody,” he said, “the police came to the door to talk to me.”
He denied that anyone in the house had been upset before he left, despite evidence of both accused wailing and shouting during a desperate 999 call seeking help.
The jury has been told they will have to watch more than 20 hours of recorded interviews with the two boys who were in the care of the Fees at the time of Liam’s death.
The trial, before Lord Burns, continues.