The surprise foray has prompted tens of thousands of civilians to flee the region as the Russian military struggles to repel the attack.