Benteng Vredeburg is opposite Gedung Agung. It was built in the year 1765 by the Dutch during the colonial domination against the cannon shot from the Sultan's palace. Its function was to protect the residence of the Dutch Residence. This fort is also surrounded by a moat which still can be seen at present. The fort is rectangular in shape with bastions on the four corners and ramparts which enable the Dutch soldiers to walk around and shoot from. From the base of the cannon on the southern rampart, one has a good view of the Sultan's Palace and other historical buildings and busy traffic around these places. The fort is within walking distance from the centre of town.
source by http://www.jogjatourism.com/html/vredeburg.htm