The seventeen-month-old King James V was crowned in Stirling almost immediately and his mother, Queen Margaret created regent as required by the provisions of the late king's will. She had little freedom of action as a ruling council, consisting of James Beaton, archbishop of Glasgow and chancellor, Alexander Gordon, 3rd Earl of Huntly, Archibald Douglas, 6th Earl of Angus, and James Hamilton, 1st Earl of Arran, was appointed to rule the country. When Queen Margaret married the Earl of Angus, the lords of the council decided that she had to give up the regency of her infant son King James V and in September, they invited John Stewart, Duke of Albany to become governor of Scotland. The arrival of Albany from France, the opposing Douglas and Hamilton factions within the council and the meddling of the pope all impinged on the outcome of the vacant archbishopric of St Andrews.