The Danes who remained in England had reacquired a taste for adventurous expeditions. They assembled along the coast of Northumberland to organize an attack on the southern portion of the kingdom; but Alfred had long resolved to fight his enemies with their own weapons. Having ridded himself of Hastings, he had had time to look to his navy, and the Danes found themselves opposed by vessels larger and more rapid than their own. The struggle began on all sides. Wherever the pirates advanced to the attack they found Saxon vessels to check them. The contests were of frequent occurrence; they were not invariably favorable to the Saxons, but the Danes suffered great losses: their ships would often founder on the coast and the cargo would be lost. In 897, the last Danish ships disappeared from England. Alfred had now only to heal his country of the wounds left on it after all its struggles, which had cemented the union of the several kingdoms, in calling them all to the common defence under a single chief placed above them by reason of his conspicuous ability. After the war with the Danes, Alfred, who had merely assumed the title of King of Wessex, had added to his states Mercia, Wales, and Kent.

It was a kingdom composed of incongruous elements; but Alfred understood the management of them by reason of his far-seeing wisdom. In Mercia, originally peopled by the English, he established a viceroy chosen from their royal family, the Ealderman, or duke Ethelred, and gave him his own daughter in marriage. When Ethelred died, after having faithfully served his father-in-law, the Mercians themselves placed in the hands of his widow Ethelfleda the reins of government.

Kent already belonged to Alfred. Its unhappy inhabitants, subject more than any others to the Danish invasions, had displayed the most passionate affection and gratitude towards the prince who had effected their deliverance. The Welsh chiefs swore allegiance to him. Alfred established one of them, Amorant, as viceroy of Wales, leaving him thus all his prerogatives and full command over his subjects.

While he was thus organizing his Saxon kingdom, Alfred was maintaining firm and friendly relations with the Danish kingdom, which he had allowed to be established near to his own. The propagation of Christianity amongst the pagans was his principal means of effecting the fusion of the races, which he foresaw and which he hoped ardently to see accomplished, but which he could not completely finish during his own lifetime. Some laws were already in force and respected by both races: the crime of murder was punished in the same manner in each state, and Alfred caused the people to rigorously respect the treaties which bound them together; the pirates of East Anglia who came to pursue their ravages along the coasts, being hanged without mercy. The Danes established in England had already become Englishmen in the eyes of Alfred, and were compelled to observe the laws of the English population.

But although thus providing for the future, Alfred felt completely safe for the present. The Saxon kings had never maintained a standing army: at the time of an invasion, when the necessity for defending himself or attacking was felt by the sovereign, he would send into the boroughs and through the country a messenger carrying his sword, unsheathed, who would cry aloud: "Whoever shall not wish to be held a worthless fellow, let him leave his house and come and join in the expedition." But the day after the battle the warriors would disperse, and if the enemy should recommence hostilities, the king and the country found themselves unprepared. Alfred divided into two great divisions all his subjects capable of bearing arms: one was always on a war footing, ready to march against the enemy; the other portion of them would work in the fields and cultivate the soil until the very day when they would be called out to follow the golden dragon, while their companions would disperse and quietly retire to their cottages. The king made use of these soldiers in fortifying towns, in constructing citadels, and in putting the whole country in a position to defend itself. It was thus that he was able to withstand the attacks of Hastings, the most severe which England had as yet encountered.

So much wisdom and foresight on the part of Alfred, naturally increased his regal importance and authority. Until this time, the Saxon kings had been essentially warriors; each "ealderman," or chief proprietor, ruled supreme in his own district, without troubling his sovereign; the clergy were nearly upon an equality with the king, and the offences committed against a bishop were punished with the same penalties as those committed against the king himself. Alfred re-established the royal supremacy by the force of his own intellectual superiority; his ealdermen became his officers, and his profound piety, as well as his respect for the clergy, did not prevent his disengaging himself from any servile submission to the Church. The priests had suffered and trembled more than any other class under the rule of the pagan Danes; they obeyed without a murmur the orders of their liberator.

Justice was but badly administered in England, divided though it had been for a long time into tythings, hundredths and counties, and provided with local assemblies which corresponded to these territorial denominations. During the troubles which the Danish invasion had caused, and in the miseries which had followed, the Saxon proprietors had ceased to attend to their internal affairs; they neglected to select the judges. The assessors, or free men who should be present on the occasion of any trial, to help the judge with their advice, no longer answered when called upon to do so; only small numbers of witnesses would appear. The king undertook to re-establish order; he himself nominated the judges, and punished them severely when they ventured to give any decision in a case without previously consulting the assessors, whom he re-established in their original form—the germ of the institution now known as the jury. He was not even satisfied with all these cares; it often happened that he would revise the sentences of the judges, so zealously did he occupy himself with the administration of justice in his kingdom.

The judges hitherto had been charged with the civil administration as well as that of justice; they were succumbing under the weight of such onerous functions. Alfred relieved them, however, by nominating dukes, earls, and viscounts, who were entrusted with the administration of justice in the counties, the tythings and hundreds. He himself compiled for these magistrates a code of laws borrowed, some from the old mode of legislation in Kent, Wessex, and Mercia, and others from the Bible, from the books of Moses as well as from the New Testament; and they all unmistakeably bore the imprint of, and were modified by, the real Christian spirit which animated the king.