In the Middle Ages Vepriai was a powerful hill fort which assisted in protection of Lithuanian lands from western threats, primarily the Teutonic Order. Wigand of Marburg asserted that the castle belonged to the Grand Duke of Lithuania. In spring of 1384, during the Lithuanian civil war of 1381–1384 the united forces of Grand Duke of Lithuania Vytautas, under command of Nartautas, and the Teutonic Order, attacked the castle which was under control of Jogaila or Skirgaila and captured it. After the threats were eliminated, in the place of the destroyed wooden defensive castle on a "piliakalnis" a residential manor was built, ruled by various noble families for several centuries.