The small child was buried in the Basilica of Saint Domenico Maggiore in Naples, Italy during the 16th century, according to the study in the journal PLOS Pathogens.
An apparent facial rash led experts to believe, initially, that the child had smallpox, also known as variola virus.
Researchers at McMaster University took a second look, using small tissue samples of skin and bone to identify fragments of DNA.
Their genomic analysis showed the virus was hepatitis B, which attacks the liver and can also cause a rash.
The discovery confirms that hepatitis B has been around for centuries, and has changed little in the past 450 years, said Hendrik Poinar, an evolutionary geneticist with the McMaster Ancient DNA Center.
"These data emphasize the importance of molecular approaches to help identify the presence of key pathogens in the past, enabling us to better constrain the time they may have infected humans," he said.
"The more we understand about the behavior of past pandemics and outbreaks, the greater our understanding of how modern pathogens might work and spread, and this information will ultimately help in their control."
Today, hepatitis B infects about 350 million people worldwide and kills about one million people each year.