Shaun Anthony Armstrong, 33, admitted killing the child on his 32nd birthday after a drinking spree at a social club.
The judge at Leeds Crown Court, Mr Justice Ognall, told him: "Your depraved conduct led you into the murder of this little girl.Your counsel speaks of your state of anguish and grief. It can surely be as nothing compared to what was suffered by little Rosie Palmer's family."
It was revealed after the hearing that Armstrong's violent sex attack may have caused her death. Pathologists were unable to find exactly what killed Rosie because it took three days to find her body.
But the man who led the police inquiry, Det Supt Doug Smith, told a news conference: "She had been severely sexually assaulted. That is a possible cause of death - the actual injury itself."
He also defended the role of the police, who were criticised by local people for not immediately searching Armstrong's flat after Rosie disappeared.
He said: "There was a lot of misinformation moving around. On the very first night Rosie went missing, certain members of the public did come forward and suggest that a certain man was responsible for her disappearance.
"That man was eliminated from the inquiry on the very first evening and that man was not Shaun Anthony Armstrong.
"There has been a complete misapprehension by certain members of the public, picked up by the media, which sent around the wrong signals suggesting that the police should have concluded this inquiry more quickly."
Rosie had left her home in Hartlepool, Cleveland, to buy a iced-lolly from an ice-cream van parked in the quiet cul-de-sac where she used to play.
Within half an hour, she lay dead in Armstrong's flat about 40 yards from her home. Her partly-clothed body was found there by police three days later.
The body, wrapped in a bin liner, was found in a landing cupboard that had been checked by police in the second of two previous routine visits to the flat.
James Spencer QC, for the prosecution, told the court that Armstrong had lived at his flat for about nine months and had shared a backyard where Rosie often played with her friends.
On the day of the killing, he reached home by taxi at 3.30pm, about the same time that the ice cream van called in the quiet cul-de-sac and Rosie had been given money by her mother, Beverley, to buy a lolly. Mr Spencer said that when Rosie's body was found, her shorts and underwear were missing.
An hour after the ice cream van left, Rosie was dead. Armstrong later went into a local shop and said he was going to help look for the little girl who had vanished; but at that time he was the only person who knew what had happened. Mr Spencer said the shopkeeper noticed blood on Armstrong's hand and was told he had been bitten by his dog, although there were no bite-marks.
Armstrong then took his dog and a bottle of cider to a nearby beach and began running in and out of the sea. Police persuaded him to return home.
Mr Smith told the news conference that officers first called at the flat the day after Rosie vanished as part of routine door-to-door inquiries in which local residents were asked to answer a questionnaire aimed at tracing her last movements.
They returned next day during an operation in which homes in the area were subjected to cursory searches, providing occupants approved, said Mr Smith.
Armstrong was "very co-operative, friendly and helpful" but on the third day of the inquiry two experienced detectives spoke to Armstrong again and noticed that "his demeanour had changed".
They noted he was "very shifty, he was described as being on edge and looking very worried. His appearance was dishevelled which he put down to heavy drinking". This behaviour switch aroused suspicion and as a result, Armstrong was arrested and a more thorough search of his flat led to the discovery of the body.
Mr Smith, responding to public criticism of the delay in finding the body, said that if it had been in the cupboard all the time, then it should have been found during the superficial search during the second visit. However, it was possible the body was not in the cupboard on that occasion as it could have been moved easily.
Gilbert Gray QC, giving mitigating evidence in court, said Armstrong suffered from low self-esteem. When he was 16, he joined the Navy but was discharged after just four months because of psychological disorder. He had attempted to kill himself on 17 occasions.