Built around 1350–1377 by Kęstutis, Duke of Trakai, Trakai Peninsula Castle was an important defensive structure protecting Trakai and Vilnius, capital of the Grand Duchy of Lithuania, against attacks of the Teutonic Knights.
The castle had seven towers connected by a 10 m (33 ft) high wall. The three largest towers, measuring 15 m × 15 m (49 ft × 49 ft), protected the most vulnerable southwestern flank. A 12–14 m (39–46 ft) wide moat separated the structure from the town. The castle was attacked in 1382 and 1383 (during the civil war of 1381–1384) and in 1390 (during the civil war of 1389–1392). After the 1422 Treaty of Melno, the castle lost its significance as a defensive structure. It is known that Grand Dukes used it as a residence. Sigismund Kęstutaitis was murdered in the castle on 20 March 1440.
In the 16th century the castle was used as a prison. Much of it was destroyed during the Russo-Polish War (1654–1667) and never rebuilt.