The fighting started at about 2p.m. (11a.m. GMT).
Five gunmen remain in the buildings, according to Yevgenia Androsova, press secretary of the Federal Security Service's branch in the Stavropol Territory, which borders on the war-torn republic of Chechnya.
She said the militants were holding two residential buildings on the opposite side of the street.
Armored vehicles have been sent to the scene, but they decided not to shell the buildings for fear that civilians might still be in the buildings.
According to Russian TV channel NTV, the militant group was uncovered during a police operation to check passports.