It is known since the XVII century as a fortified town which belonged to Rich Pospolyta. The origin of the name comes probably from the name of wild flowers "kozelets'" that were growing in neighborhood.
Since 1649 it was the centre of Kozelets' squadron.
In 1654 the town has received the Magdeburg Right and an emblem with a picture of a he-goat with a cross on its back.