A western Pennsylvania couple, accused of luring their five-year-old son into the trunk of their car with candy to resolve his fear of the dark, was granted probation this week, according to court officials on Friday.

Jeffrey and Danielle Lenhart were charged with felony child endangerment and reckless endangerment for locking their son in the car during three trips to the Idlewild amusement park in Lingonier, Pennsylvania, in July 2013, court records showed.

They gave him a flashlight and told him to look for sweets before locking the trunk at the park, about 9.5-miles (15 km) from their home in Latrobe, court officials said.

They were accepted into the Accelerated Rehabilitative Disposition program on Thursday in a deal approved by Westmoreland County Judge Richard McCormick Jr., according to Danielle Lenhart's lawyer, Deborah Jackson.

"She recognizes the serious nature of what has happened and I don't think we will see her in court again," Jackson said of her client.

The incidents came to light when one of the couple's children was interviewed by child welfare officials for undisclosed reasons, according to the Pittsburgh Tribune Review.

The boy and another sibling, who is 4, have been staying with relatives following the charges, but will be returned to the home, court officials said. A younger sibling, 1, has already been reunited with the parents.

Upon completion of two years probation, charges against the Lenharts will be dismissed and records expunged, Jackson said.

A previous judge in the case did not want to allow the Lenharts to enter the rehabilitative program, but Jackson said she was pleased with McCormick's decision.