Mark Drakeford will remain first minister and may be able to govern without the support of a coalition partner, as the presiding officer does not vote.
Labour’s performance in Wales was in marked contrast to the party’s fortunes in England, where Keir Starmer lost the Hartlepool by-election and shed more than 180 councillors.
The difference may reflect voters’ approval of Mr Drakeford’s handling of the coronavirus pandemic, in which he has repeatedly taken an independent line from the UK government.
Labour gained one seat to match the tally of 30, which it previously achieved in 2003 and 2011.
Conservatives gained five seats, leapfrogging Plaid Cymru to become the second-largest party at Cardiff Bay with 16 MSs. Plaid gained one seat to end on 13, while Liberal Democrats took just one.
Ukip was left with no representation in the Senedd, losing all seven seats it won in 2016 in the run-up to the EU referendum, including that of party leader Neil Hamilton.
Mr Drakeford said he had offered “a radical manifesto with a host of ideas that are ambitious for Wales”.
“I’ll be very keen to ensure that we give that the most powerful sense of momentum behind it to get those things happening here in Wales,” he said.
Welsh Liberal Democrat leader Jane Dodds, who won a regional seat in Mid and West Wales after her party lost the Brecon and Radnorshire constituency to the Conservatives, said she has yet to be approached by Mr Drakeford to help form the next government.
She told BBC Radio Cymru: “I need to speak to other people within the party and we shall have to see.”
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies