Police charged a man with murdering a 7-year-old girl taken from a relative's home in the middle of the night after they found her body in his car early Sunday.

Police said Ryan Bois, 20, took the girl from a Weymouth home after she had been dropped off for a sleep-over.

Police said they discovered the girl's body in the back seat of Bois' car after they tried to pull him over at about 1:30 a.m. for driving erratically in the Washington Street area of Weymouth.

Bois allegedly tried to flee, crashing the car into a taxi near the Quincy shipyard. Bois took off on foot. The officer gave chase, releasing a police dog that chased and held Bois until police could take him into custody.

Bois was arrested for motor vehicle charges and for threatening a police officer with a knife.

Those charges were increased to murder after police said they found the girl's body in the back seat of his car.

Police did not initially identify the girl, who lived in Weymouth, saying all family members had not been notified.

Investigators said that Bois, who is homeless, was known to the family.

"We've been given information that there may be some kind of familial relationship between Bois and the family," said David Traub, a spokesman for Norfolk County District Attorney William Keating.

Investigator said the girl suffered trauma to the body, but declined to give a cause of death or discuss any other possible injuries until after an investigation by the medical examiner's office.

They were also investigating whether the car Bois was driving was stolen from the family.

Bois was to be arraigned Monday in Quincy District Court.