De Lacy built a huge ringwork castle defended by a stout double palisade and external ditch on top of the hill. There may also have been further defences around the cliffs fringing the high ground. Part of a stone footed timber gatehouse lies beneath the present stone gate at the west side of the castle. The ringwork was attacked and burnt by the Irish but De Lacy immediately rebuilt it in 1173. His son Walter continued rebuilding and the castle was completed c 1204.
De Lacy used the site as a fortress and a means of controlling trade and transportation along the Boyne. Since he already controlled the port city of Drogheda, Trim served as a connecting point of control between east and west in County Meath and a defensive stronghold.
The next phase of the castle’s construction took place at the end of the 13th century, and the beginning of the 14th century. A new Great Hall with undercroft beneath it and an with attached solar in a radically altered curtain tower, and a new forework forebuilding, and stables were added to the keep.
After de Genneville's death his widow Joan married Roger Mortimer and the castle passed to the Mortimer family who held it until the lord of Trim became Edward IV king of England in 1461.
The castle was an important early medieval ecclesiastical and royal site, and although the site is about 25 miles from the Irish Sea, it was accessible in medieval times by boat up the River Boyne. Trim Castle is referred to in the Norman poem “The Song of Dermot and the Earl.”
Trim Castle grew to feature a great hall and a mint which were used extensively in the 15th and 16th centuries, concurrent with the time parliaments were held in the castle. During the 15th century the Irish Parliament met in Trim Castle seven times. It fell into decline in the 16th century but was refortified during the Cromwellian wars in the 1640s.
In the 17th and 18th centuries, the function of the castle turned more militaristic, as remains of hearths and a blackmith’s forge show evidence of lead melting and casting, and the castle was fitted with gun loops
After the wars of the 1680s, the castle was granted to the Wellesley family who held it until Arthur Wellesley (the First Duke of Wellington), sold it to the Leslies. In following years it passed via the Encumbered Estates Court into the hands of the Dunsany Plunketts. They left the lands open and from time to time allowed various uses, with part of the Castle Field rented by the Town Council as a municipal dump for some years.. The Dunsanys held the Castle until 1993, when after years of discussion, Lord Dunsany sold the land and buildings to the Irish State, retaining only river access and fishing rights.
The Office of Public Works began a major programme of conservation and exploratory works, costing over six million euro, including partial restoration of the moat and the installation of a protective roof. The castle was re-opened to the public in 2000.