When they brought the boy to Jesus, Jesus rebuked the demon that was causing the epilepsy. As a result, the demon came out of the boy, and right then the boy was healed.