Stephen Doughty's victory is seen by Labour as vindication of the party's efforts across the UK and the work of the Labour-led Welsh assembly government.
Turnout was low, with only a quarter of the 75,000-strong electorate casting their ballot. Doughty, 32, a former Oxfam worker, polled almost half of the votes cast: 9,193 out of almost 19,500.
The Tories came in second and the Liberal Democrats third, as they did at the 2010 general election, but with reduced shares of the vote. The Lib Dem percentage halved, from 22% to 11%. Plaid Cymru, the Welsh nationalist party, and Ukip both doubled their shares.
The byelection was called after the veteran MP Alun Michael stepped down to contest the police and crime commissioner election for South Wales police.
Doughty said the result showed that voters were being hurt by the cuts imposed by the Tory-Lib Dem coalition in Westminster. He called for stronger regulation of banks and a "greater sense of community and society".
He said: "We have substantially increased our share of the votes from the 2010 election and that shows how fed up people are with the policies of this coalition government. The biggest challenge facing the country is the economy. People are worried about jobs and the financial cuts. We are showing that there is a real alternative."
Doughty said he was disappointed by the turnout, but added: "You have to remember it has been a very cold and wet November, so some people may have decided against turning out."
It was no surprise that Doughty won as the area – which includes inner-city neighbourhoods such as Grangetown, the redeveloped waterfront around Cardiff Bay and the affluent town of Penarth – has been a Labour stronghold since the second world war.
But the performance of the Tories, whose share of the vote slipped from 28% in 2010 to 20%, and the Liberal Democrats will cause concern for the coalition partners.
Michael, who had been MP for 25 years, was one of the first to congratulate Doughty, saying: "Stephen has fought a very good campaign and the share of the vote he received, particularly for a newcomer, was impressive. He has grown up in the constituency, so he has his finger on the pulse.
"As for what practical advice I would give him, I would only say maintain your values and beliefs and also expect have to deal with a wide range of issues – some of which you would never even think you may have to contend with."
guardian.co.uk © Guardian News and Media Limited 2010
image: © EdMiliband