Children know lying is wrong from a young age, but that doesn’t stop them from doing it. Most parents (myself included) wonder how to encourage kids to tell the truth, whether it be about a broken lamp or a missed homework assignment.

A new study suggests that parental behavior can help steer children to tell the truth. In work published online this month in the Journal of Experimental Child Psychology, researchers found that children who anticipate a positive reaction from their parents after a confession are more likely to come forward, even if they might be punished.

“A parent who stays calm in the moment — listening to their kid and expressing pleasure their child has been honest — is more likely to have that happen again,” says study author Craig Smith of the University of Michigan Center for Human Growth and Development. The findings support past research that has shown celebrating honesty as a virtue encourages kids to be more truthful.

Smith, along with coauthor Michael Rizzo at the University of Maryland, invited a small group of 4- to 9-year-olds to listen to stories about children committing misdeeds. In each story, a fictional child does some bad deed, such as stealing candy from a friend, then subsequently lies or confesses about it. Each participant heard the same stories.

During each story, the researchers asked the children about what the characters were feeling: Did the protagonist feel good after he stole the candy? How did he feel when he lied about it? Or confessed?

On average, the 4- to 5-year-olds associated positive feelings with lying, and expected that confessing would lead to bad feelings. The older children, however, had the opposite reaction: 7- to 9-year-olds associated positive feelings with confession. Those differences were expected, says Smith, as older children typically think about situations in more complex ways than their younger counterparts, such as understanding that a person can feel simultaneously happy to have candy, but guilty for taking it.

The psychologists also asked the children’s parents to fill out a survey about lying and confession behavior at home. Interestingly, children who were more likely to expect a fictional adult would feel happy about a child’s confession — even if the adult was also angry about the child’s misdeed — were also more likely to confess at home in real life. This trend held true regardless of the child’s age.

To encourage kids to fess up in the future, forget threatening punishment. Instead, parents should focus on trying to not get angry immediately after a confession, says Smith. “You can say, “I’m not always happy with what you do, but telling the truth is important, and I’m happy you told me what happened.’”

(By Megan Scudellari BOSTON GLOBE CORRESPONDENT  JANUARY 24, 2017)