The earliest reliable records of the city begin about 876, when the Danes overwhelmed the city and were put to flight by King Alfred. A few years later they again besieged Exeter, but this time it held out against them until the King, for the second time, came to the rescue, and the enemy retreated. Alfred, careful of the city and its means of defence, built a stronghold--very possibly in the interval between these two invasions--upon the high ground that the Briton had chosen for his fastness, and on which the Castle rose in after-days. Rather more than a hundred years later Athelstan strengthened the city by repairing the Roman walls. But it is with an event of greater importance that Athelstan's name is usually associated, for it was he who made the city a purely English one by driving out all the Britons into the country beyond the Tamar. It is probable that there was already a monastery in Exeter in the seventh century, and that it was broken up during the storms that raged later. In any case, Athelstan founded or refounded a monastery, and in 968 Edgar, who had married the beautiful daughter of Ordgar, Earl of Devon, settled a colony of monks in Exeter. About thirty years afterwards the Danes, under Pallig, sailed up the Exe and laid siege to the town, but were repulsed with great courage by the citizens. Beaten off the city, they fell upon the country round, and a frightful battle was fought at Pinhoe. A curious memorial of it survives to this day. During the furious struggle the Saxons' ammunition began to run low, and the priest of Pinhoe rode back to Exeter for a fresh supply of arrows. In recognition of his service, the perpetual pension of a mark (13s. 4d.) was granted him, and this sum the Vicar of the parish still receives. Two years later the Danes made a successful assault upon the city, and seized much plunder, but made no stay.
Edward the Confessor visited Exeter, and assisted at the installation of Leofric as first Bishop of Exeter, when the see was transferred from Crediton. The Queen also played a prominent part in the ceremony, for Exeter and the royal revenues within it made part of her 'morning gift.' Leofric instituted several reforms, added to the wealth of his cathedral, and left it a legacy of lands and books. The most interesting of the manuscripts is the celebrated _Exeter Book_, a large collection of Anglo-Saxon poems on very different subjects. To give some idea of their variety, it may be mentioned that, amongst other poems of an entirely distinct character, there are religious pieces, many riddles, the legends of two saints, the Scald's or Ancient Minstrel's tale of his travels, and a poem on the 'Various Fortunes of Men.'