Assassination
While the legend asserts that Erik was unanimously accepted as king, the circumstances reveal that this was not the case. Apart from Karl Sverkersson in Östergötland, the Danish prince Magnus Henriksen had a claim to the throne, being the great-grandson of Inge I and the great-great-grandson of King Sweyn Estridson of Denmark.
According to the legend, the Devil inspired Magnus in his machinations. He used gifts and grand promises to attract Swedish nobles, including "a mighty man in the kingdom". If this is based on sound tradition it may mean that Magnus allied with Karl of the rival House of Sverker. This assumption is supported by a statement in a late medieval chronicle.
Unbeknownst to the king, the allies gathered a considerable army and accosted Erik near Uppsala at Östra Aros when he attended Mass on the Feast of the Ascension in May 1160. The king, being informed of the approach of the enemy, heard mass to the end, then armed himself and the few men at hand, and went out to meet Magnus' troops. He was pulled off his horse onto the ground by the swarming rebels, who taunted and stabbed him, then beheaded him.
Some of the details of Erik's violent end seem to be corroborated by a scientific investigation of his bones (see below). Otherwise, a papal bull to his son Knut confirms that he was killed by unspecified enemies. The short chronicle in the Västgötalagen from c. 1250 says: "The twelfth was King Erik. He was too soon put to death at an unfortunate moment, He always made good deeds while he was alive, and was therefore rewarded by God and his angels; his bones rest in Uppsala. He has there presented many good portents by the grace of God." In a letter from 1172, Pope Alexander III complains that some people in Sweden had begun worshiping "a man who had been killed in debauchery and feasting". Some scholars have assumed that this alludes to King Erik, and that the celebration of the Ascension Day was accompanied by feasting which enabled the surprise rebel attack. The identification is uncertain, however.