Labour suffered a sensational defeat in its safest Welsh seat as Tony Blair secured an historic third term victory.
Independent former Labour AM Peter Law overturned a 19,000 majority in Blaenau Gwent to win by 9,121.
Lib Dems gained Cardiff Central and Ceredigion, and Tories returned to the electoral map in Monmouth, Preseli Pembrokeshire and Clwyd West.
Plaid Cymru suffered, failing to take its top target seat of Ynys Mon from Labour, and also losing Ceredigion.
Although Labour suffered several losses, it remained easily the biggest party in both Wales and throughout the UK as Tony Blair won his third election.
With the last of the 40 Welsh results in just before 0500BST, Labour won 29 seats, down five. Lib Dems doubled their seats to four and Conservatives were up to three from zero in the previous two elections.
The loser was Plaid Cymru, which slipped back to three seats from four.
Jenny Willott became Cardiff's first Liberal Democrat MP
Blaenau Gwent delivered by far the biggest shock. Mr Law, the local Welsh assembly member who left Labour in protest at the party's use of all-women shortlists to pick its candidate, received 20,505 votes, or 58% of the total
Labour's Maggie Jones won 11,384 votes, or 32%. That was 40% down on Labour's 2001 result.
2005 WELSH RESULT
Labour: 29 seats (-5); 42.7% (-5.9%)
Liberal Democrats: 4 (+2); 18.5% (+4.6%)
Conservatives: 3 seats (+3); 21.4% (+0.4%)
Plaid Cymru: 3 seats (-1); 12.6% (-1.7%)
Independent: 1 seat (+1)
Plaid Cymru suffered two serious blows. First, Labour's Albert Owen retained Ynys Mon - Plaid's top target seat - increasing his majority from 800 to 1,242.
Then Plaid policy director Simon Thomas lost Ceredigion, his 4,000 majority overturned by Lib Dem Mark Williams, who won by 200 votes.
Just before polling day Plaid president Dafydd Iwan said a good result for his party would be to hold its four seats and regain Ynys Mon.
Eight years after the Tories were wiped out in Wales, they took three seats from Labour.
David Davies won Monmouth, the seat he has held as an assembly member since 1999, turning Labour's 700 majority into a 4,527 winning margin.
Tories won their second seat in Preseli Pembrokeshire, where Stephen Crabb won by 607 votes, from a Labour majority of almost 3,000. In the final Welsh result of the night, Tory David Jones took Clwyd West by 133 votes after a recount.
But there was disappointment elsewhere for the Tories, who failed to capture their target seats of Vale of Glamorgan and Cardiff North, which were both held by Labour.
David Davies will stand down from the assembly in 2007
Victorious Newport West Labour candidate Paul Flynn urged Tony Blair to quit soon.
Mr Flynn, known as a maverick and an MP since 1987, said Mr Blair was a big problem on the doorsteps because of Iraq and his personality.
The last general election four years ago produced a virtual standstill result both in Wales and throughout the UK as a whole.
But this election was far more dramatic, with Labour and Plaid both suffering setbacks, and Lib Dems doubling their total number of Welsh seats.
Turnout rose by 1.8% from its 2001 figure to 62.4%. The highest turnout was 72.4% in Monmouth and the lowest 52.4% in Swansea East.