text: With all the results now declared, Jac Larner of Cardiff University sums up the night for Wales' five main parties.
  WELSH LABOUR
  Labour have exceeded all expectations in Wales.
  They have outperformed every single Wales-only poll over the course of the campaign - and the exit poll - achieving their highest share of the vote in Wales since 1997.
  Not only did they successfully defend their 25 seats, but they gained three seats from the Conservatives, taking their total to 28 in Wales.
  This is their best performance in terms of seat share since 2005, and their best performance in terms of share of the Wales vote since the New Labour landslide of 1997.
  This extends their run of winning general elections in Wales to 26 in a row.
  WELSH CONSERVATIVES
  The Conservatives also saw their vote share increase across Wales by 6.3%, but this was not enough for them to hold off Labour's surge in Wales.
  Early in the night they were confident about gaining seats in Bridgend, Newport West and in the north east of Wales, so a net loss of 3 seats will be a big disappointment.
  Historically, the Conservatives have always performed worse in Wales than in England at every election going back to 1859, and this election looks to be no different.
  PLAID CYMRU
  It was a strange night for Plaid Cymru that ended in success with the election of their youngest ever MP, Ben Lake.
  They increased their parliamentary representation, taking Ceredigion from the Liberal Democrats, and their vote held up where they were defending the three seats won in 2015.
  Their group of four MPs is the party's largest Westminster cohort since the 2001 general election.
  Yet their vote share fell nationally by 1.7% and they lost votes in their other target seats of Ynys Mon, Llanelli and Rhondda.
  However, Plaid will view themselves as one of the few winners in this election on a night where smaller parties saw their vote share squeezed across the UK.
  LIBERAL DEMOCRATS
  The Liberal Democrats' torrid time at elections in Wales continues.
  They won their worst ever share of the vote in the party's history in Wales, and lost their solo MP Mark Williams in Ceredigion to Plaid Cymru.
  With only one AM in Wales, and limited representation in local government in Wales, the Liberal Democrats can no longer be considered to be a significant political player in the country.
  It is the first time since the founding of one of the Lib Dem's predecessor party, the Liberals, in 1859 that they will have no Westminster representation in Wales.
  UKIP
  UKIP's vote share has collapsed considerably across Wales, polling 11.6% less than 2015 after 38 constituencies had been called.
  Opinion polling across the campaign suggested that around two-thirds of the 2015 UKIP vote would go to the Conservatives.
  From the results we have seen so far, it seems that a significant proportion of these voters have voted for Labour in Wales.
target: It has been a dramatic night that has confounded expectations of political parties and commentators.