Query: In what year was Hugh Capet elected as king?
Context: Fortification of the Île-de-France failed to prevent sacking by Vikings in 845 but Paris' strategic importance—with its bridges preventing ships from passing—was established by successful defence in the Siege of Paris (885–86). In 987 Hugh Capet, Count of Paris (comte de Paris), Duke of the Franks (duc des Francs) was elected King of the Franks (roi des Franks). Under the rule of the Capetian kings, Paris gradually became the largest and most prosperous city in France.