A fort which has stood for well over 2,000 years is finally about to succumb to invasion – by the sea – prompting a race against time for archaeologists to uncover its mysteries.

Dinas Dinlle, near Caernarfon in north Wales, is believed to have been built in the Iron Age, but was later inhabited by the Romans. The land near the site is rapidly eroding and will eventually be entirely lost to the sea.

A dig is underway at the National Trust-owned site, but comes to an end on Tuesday.

The hillfort is built on an unusual hill of glacial drift sediments and overlooks the sea and the Caernarfonshire coastal plain, and in recent history was used in the Second World War pill box and observation post, and has latterly formed part of a golf course.

According to archaeologists from the Royal Commission on the Ancient and Historical Monuments of Wales, which is leading the work at the site with funding from the EU, the fort was originally entirely enclosed, but the majority of the defences on the western side have already been lost to the sea.

Britain's oldest tree: 3000 year old Fortingall Yew Show all 8 1 /8 Britain's oldest tree: 3000 year old Fortingall Yew Britain's oldest tree: 3000 year old Fortingall Yew The Fortingall Yew in Perthshire is estimated to be up to 3000 years old SWNS Britain's oldest tree: 3000 year old Fortingall Yew But campaigners have warned that the ancient tree may be dead within decades amid concerns that tourists are breaking off pieces and tying trinkets to its branches SWNS Britain's oldest tree: 3000 year old Fortingall Yew The tree has declined somewhat in recent centuries, the wooden pegs mark the girth of the trunk when it was at its widest in 1769 Trish Steel Britain's oldest tree: 3000 year old Fortingall Yew Warden Neil Hooper told The Herald that “certainly some needles, twigs, even bits of branches have been torn off”. SWNS Britain's oldest tree: 3000 year old Fortingall Yew Catherine Lloyd, of the Tayside Biodiversity Community Partnership, states: “They are attacking this poor tree, it’s stressed, and whether that’s the reason this poor tree is not doing very well at the moment, we don’t know.” SWNS Britain's oldest tree: 3000 year old Fortingall Yew Tourists are also attaching cloths and beads to the tree SWNS Britain's oldest tree: 3000 year old Fortingall Yew Resident Willie Watson removes beads that have been left on the tree by tourists SWNS Britain's oldest tree: 3000 year old Fortingall Yew The ancient tree is a tourist attraction with many people travelling to see it SWNS

Using Ordnance Survey mapping, the team has calculated between 20 and 40 metres of the western side of the fort has been lost since 1900.

Peat deposits at the foot of the cliff below the hillfort have led scientists to estimate the sea would have been a kilometre away 4,000 years ago.

But recently, greater levels of erosion have been seen at the southern end of the fort where considerable impacts were recorded in February this year.

Part of the current work on the fort is to assess the impact of climate change on the structure.

Rising sea levels, the drying out and desiccation of soils, flooding and more frequent storms all present “significant challenges” to Dinas Dinlle, hastening the erosion of the monument, the team said.

The site has been laser scanned and surveyed by drone to provide accurate monitoring of the rate of erosion.

The current dig is examining “numerous possible roundhouses and other anomalies within the interior of the fort”.

Previous archaeological activity turned up Roman coins, an intaglio (a carved gemstone worn in a ring) and bits of pottery, indicating it was likely inhabited during the Roman occupation of Britain.

“There is a possibility that the prominent, squarish stone mound inside the fort is the remains of a building or tower; could it be a Roman pharos or lighthouse? Early medieval occupation of this prominent site is also very likely,” the team said.