[1][2] Over a period of 30 years, it was built by Hugh de Lacy and his son Walter as the caput of the Lordship of Meath.
The Irish Government currently own and are in charge of the care of the castle, through the state agency The Office of Public Works (OPW).
[4] De Lacy built a huge ringwork castle defended by a stout double palisade and external ditch on top of the hill.
De Lacy left Ireland entrusting the castle to Hugh Tyrrel, baron of Castleknock, one of his chief lieutenants.
[8] Mathilda having died in 1304, in 1308 Geoffrey conveyed his Irish lordships to Roger Mortimer, and entered the priory at St. Mary's in Trim.
In 1649 after the sacking of Drogheda, the garrison of Trim fled to join other Irish forces and the place was occupied by the army of Oliver Cromwell.
The design of the central three-storey keep (also known as a donjon or great tower) is unique for a Norman keep being of cruciform shape, with twenty corners.
The castle interior was partially the subject of archaeological digs, by David Sweetman of the OPW in the 1970s, and more extensively by Alan Hayden in the 1990s.
[citation needed] Apart from the keep, the main extant structures consist of the following: an early 14th-century three-towered fore work defending the keep entrance and including stables within it (accessed by a stone causeway crossing the partly filled-in ditch of the earlier ringwork); a huge late 13th-century three-aisled great hall (with an under croft beneath its east end opening via a water gate to the river); a stout defensive tower (turned into a solar in the late 13th century at the northern angle of the castle); a smaller aisled hall (added to the east end of the great hall in the 14th or 15th century); a building (possibly the mint) added to the east end of the latter hall; two 15th- or 16th-century stone buildings added inside the town gatehouse, 17th-century buildings (added to the end of the hall range and to the north side of the keep) and a series of lime kilns (one dating from the late 12th century, the remainder from the 18th and 19th centuries).
[13] In 2003 there was a controversy surrounding the decision by the Minister for the Environment, Heritage and Local Government Martin Cullen not to oppose the construction of a five-storey hotel across the road from the castle.
The development had been condemned by a local councillor, a senior inspector in An Bord Pleanála (acting in a private capacity, and later choosing to withdraw his appeal lest it be considered a conflict of interest) and heritage bodies, many of whom had been critical of the government's treatment of other heritage sites such as Carrickmines Castle (the ruins of which were excavated partly to allow the completion of a roadway).