The Scottish National Party took 64 of the 129 parliamentary seats up for grabs, just one short of an overall majority.