Welsh Assembly election: Labour eyes fifth term in power
The 1997 general election marked the high watermark for Labour in Wales with 34 of the nation's 40 MPs delivering one of their best results.
But when the first assembly elections were held in May 1999, the party came back down to earth with a bump.
Before a vote was cast in the election the party had faced a bitter leadership battle between Alun Michael and Rhodri Morgan.
Mr Michael, the choice of the then Labour leader and prime minister Tony Blair, won with the support of the union block vote even though the party membership in Wales had voted for Mr Morgan. It led to accusations the party was "run from London".
That cost Labour dearly, as historic parliamentary strongholds like Rhondda, Llanelli and Islwyn were all taken by Plaid Cymru in the first election for the new assembly.
The man who ran Labour's election campaign, former Neath MP Peter Hain, said the results showed the party was in a "crisis" and in clear need of regeneration.
Mr Hain said it was "a stark warning in Wales in our heartlands - we have been too complacent for too long".
It led to a long period of soul-searching and, a few months later, a report into what went wrong concluded the party needed to "to shake off the impression that it is run from London" and reposition itself as the "true party of Wales".
With 28 AMs, Labour formed a minority government led by Alun Michael. But it did not last long as Mr Michael shocked colleagues and opponents alike by standing down in February 2000 before a vote of no confidence in his leadership.
So after losing out in two leadership elections - first to Ron Davies and then to Alun Michael - Rhodri Morgan became leader and first secretary, a title changed to first minister in October 2000.
Mr Morgan decided to take his party into a coalition with the Liberal Democrats in order to form a majority government.
Under his leadership, the party in Wales also started to forge its own identity; most noticeably Mr Morgan's use of the phrase "clear red water" to show the difference between Labour in Wales and Labour at Westminster.
By the next election in 2003, the party had recovered slightly from the humiliation of 1999. Labour regained Llanelli, Rhondda and Islwyn from Plaid. However, they lost Wrexham to John Marek, former Labour MP and AM for the seat, who had been de-selected by the party only to stand as an independent. Overall, Labour ended the day with 30 AMs, a net gain of two seats, and governed alone.
But that working majority did not last. A row in Blaenau Gwent over all-woman shortlists for the 2005 general election led to a local rebellion. AM Peter Law quit the Labour party, stood against the chosen candidate, Maggie Jones, and won.
It was a massive embarrassment for the party to lose its safest parliamentary seat in Wales. Mr Law remained as an independent AM and MP until his death in 2006.
Even the most optimistic Labour supporter would have found it difficult to draw any comfort from the result in 2007. The party lost six constituency seats, as its total vote fell by almost eight percentage points. Labour won two seats on the regional lists to give a total of 26 AMs.
For a while, it almost seemed possible that the party would be out of government as a "rainbow coalition" between Plaid Cymru, the Conservatives and the Liberal Democrats was on the cards.
Rhodri Morgan seemed to capture the fears of Labour AMs when he said: "We are not entirely masters of our own destiny now."
In the end, more than two months after polling day, Labour secured its position in power by forming another coalition - this time with Plaid Cymru - to create the "One Wales" government which would last until the next assembly election in 2011.
After a decade at the helm of Welsh Labour, in September 2009 Rhodri Morgan announced he would stand down as both first minister and Labour leader at the end of that year.
Carwyn Jones, Edwina Hart and Huw Lewis all stood in the contest to succeed Mr Morgan, with Mr Jones coming out on top with 52% of the vote.
In May 2010, Labour was out of power at Westminster as the Conservative/Lib Dem coalition was formed. For the first time since devolution, opposing parties were in charge at opposite ends of the M4.
Compared with 2007, Labour restored its battered fortunes in the assembly in 2011. The party's share of constituency votes increased resulting in a gain of four seats. Labour ended up with 30 of the assembly's 60 seats and chose to govern alone, rather than in coalition with another party.
But if the main threat to Labour dominance in its industrial heartlands came from Plaid Cymru in 1999, this year it may well be UKIP putting up a major challenge. In the 2015 general election UKIP finished second in six seats, all held by Labour - Aberavon, Swansea East, Blaenau Gwent, Merthyr Tydfil and Rhymney, Caerphilly, and Islwyn.
Even if UKIP does not go on to win those seats, it could take enough votes from Labour elsewhere to make life difficult.