St Fergus is a village in the Buchan area of Aberdeenshire, Scotland. St Fergus lies 1 mile (1.6 km) from the North Sea coast and 3 miles (5 km) north-west of Peterhead. The Parish of St Fergus includes the remains of Inverugie Castle and Ravenscraig Castle. The church in the village was built in 1763. The church for this parish previously stood in the old kirkyard near the shore 2 miles (3 km) to the east. This site on the St Fergus Links is still used as a burial ground. Prior to the change in site of the church the parish was known as Longley and at a still more remote period Inverugie.