The election ended in the first hung parliament after an election for 36 years, with the Tories gaining the most seats and votes but being 20 seats short of an overall majority.