Prehistoric Shetland refers to the prehistoric period of the Shetland archipelago of Scotland, when it was first occupied by humans. The period prior to human settlement in Shetland is known as the geology of Scotland. Prehistory in Shetland does not end until the beginning of the Early Medieval Period in Scotland, around AD 600. More than 5,000 archaeological sites have been recorded in the Shetland Islands.
 A midden site at West Voe on the south coast of Mainland, dated to 4320-4030 BC, has provided the first evidence of Mesolithic human activity in Shetland. The same site provides dates for early Neolithic activity and finds at Scord of Brouster in Walls have been dated to 3400 BC. This site includes a cluster of six or seven walled fields and three stone circular houses that contains the earliest hoe-blades found so far in Scotland. "Shetland knives" are stone tools that date from this period made from felsite from Northmavine.
 Heel-shaped cairns,  are a style of chambered cairn unique to Shetland, with a particularly large example on the island of Vementry. Staneydale Temple near Bixter is a large Neolithic ruin containing an oval chamber. Around it are the remains of houses, walls and cairns of the same period. There are numerous Neolithic era standing stones including those at Yoxie on Whalsay and at Boardastubble, Unst. Hjaltadans on Fetlar is a ring of stones,  although there are no true stone circles as such in Shetland. Funzie Girt is a remarkable dividing wall that ran for 4 kilometres (2.5 mi) across the island of Fetlar. The level of organisation involved suggest a relatively high population for Shetland in the Neolithic, perhaps as much as 10,000.
 Pottery shards found at the important site of Jarlshof indicate that there was Neolithic activity there although the main settlement dates from the Bronze Age. This includes a smithy, a cluster of wheelhouses and a later broch. The site has provided evidence of habitation during various phases right up until Viking times.
 Numerous brochs were erected during the Iron Age. The Broch of Mousa is the finest preserved example in Scotland of these round towers. In addition to Mousa there are significant broch ruins at Clickimin, Culswick,  Old Scatness and West Burrafirth, although their origin and purpose is a matter of some controversy.  In 2011 the collective site, "The Crucible of Iron Age Shetland" including Broch of Mousa, Old Scatness and Jarlshof  joined the UKs "Tentative List" of World Heritage Sites.
 In AD 43 and 77 the Roman authors Pomponius Mela and Pliny the Elder referred to the seven islands they call Haemodae and Acmodae respectively, both of which are assumed to be Shetland. Thule is first mentioned by Pytheas of Massilia when he visited Britain sometime between 322 and 285 BC, but it is unlikely he meant Shetland as he believed it was six days sail north of Britain and one day from the frozen sea (description that seems referred more or less with Iceland). However, another early written reference to the Shetland islands may have been when Tacitus reported that the Roman fleet had seen "Thule" on a voyage that included Orkney in AD 98. Watson (1926) states that Tacitus was referring to Shetland, although Breeze (2002) and D. Ellis Evans (1975) are more skeptical (because they think that Tacitus included Shetland in the "Orcades islands", as the northernmost area of the Orkney archipelago). The Roman presence in Scotland was little more than a series of relatively brief interludes of partial military occupation "within a longer continuum of indigenous development" and there is no evidence of any direct contact between Shetland and Roman forces. But for Orkney there are some significant archeological evidences: according to scholars like Montesanti, "Orkney might have been one of those areas that suggest direct administration by Imperial Roman procurators, at least for a very short span of time". 
 The later Iron Age inhabitants of the Northern Isles were probably Pictish, although the historical record is sparse. Hunter (2000) states in relation to King Bridei I of the Picts in the sixth century AD: "As for Shetland, Orkney, Skye and the Western Isles, their inhabitants, most of whom appear to have been Pictish in culture and speech at this time, are likely to have regarded Bridei as a fairly distant presence."
 The St Ninian's Isle Treasure was discovered in 1958 by a local schoolboy, Douglas Coutts. Coutts was helping visiting archaeologists led by A. C. O'Dell of Aberdeen University at a dig on the island. The silver bowls, jewellery and other pieces are believed to date from approximately AD 800. O'Dell stated that "The treasure is the best survival of Scottish silver metalwork from the period" and that "the brooches show a variety of typical Pictish forms, with both animal-head and lobed geometrical forms of terminal".
 Shetland was colonised by Norsemen in the late 8th and 9th centuries; the fate of the previous indigenous population is uncertain. According to the Orkneyinga Saga, Vikings then used the islands as a base for pirate expeditions against Norway and the coasts of mainland Scotland. In response, Norwegian king Harald Hårfagre ("Harald Fair Hair") annexed the Northern Isles (comprising Orkney and Shetland) in 875 and Rognvald Eysteinsson received Orkney and Shetland from Harald as an earldom in reparation for the death of his son in battle in Scotland. Some scholars believe that this story is apocryphal and based on the later voyages of Magnus Barelegs. Nonetheless, as the Viking era developed Shetland emerged from the prehistoric period and into the era of written history.