When the HolySpirit leaves a person or a person determines to act carnally, Satan or one of his demons enters the individual. That demon is not ^sent^ by the HolySpirit, he simply takes advantage of a rebellious, carnal mind and heart.
From the observer^s perspective it is such a violent change that it appears to have been caused by the HolySpirit.