First Minister Vaughan Gething has insisted he is not going to resign, after losing a vote of no confidence because two Labour members were off sick.
After one of the most extraordinary debates in the 25 years of Welsh devolution, 29 Senedd members voted in favour of the resolution while 27 voted against.
The parliament's rules do not require Mr Gething to quit and he told reporters: "I'm going to carry on doing my duty."
Opposition parties called for him to go, with Plaid Cymru leader Rhun ap Iorwerth even saying senior Welsh government figures had wanted the vote to happen.
The Senedd vote was called by the Conservatives over donations made to Mr Gething’s leadership campaign by a company owned by a man previously convicted of environmental offences.
There are 60 members of the Welsh Parliament - Labour holds exactly half of the seats with 30 members, while there are 16 Tories, 13 Plaid Cymru members and a solitary Liberal Democrat.
There were two absences among the government's Labour members - former social partnership minister Hannah Blythyn and ex-transport minister Lee Waters were ill.
Speaking later, Mr Gething ruled out standing down saying that he would travel to Normandy on Wednesday night to take part in D-Day commemoration events.
He described the no confidence vote as a "desperate gimmick" from the Conservatives during the general election campaign.
"Months and months of innuendo are damaging and hurtful," he said.
But Welsh Conservative Senedd group leader Andrew RT Davies said he had "lost the confidence of the people of Wales".
“He has lost the confidence of the Senedd. The only person who is still batting for Vaughan Gething is Keir Starmer.”
Plaid Cymru leader Rhun ap Iorwerth said the Senedd had "spoken on behalf of the people of Wales - we have no confidence in the Labour first minister".
“His government is clearly in disarray and as such is unable to face the significant challenges ahead for Wales."
Speaking later, to OceanNewsUK, he said that even "senior Labour members of his government were eager for this vote to take place because they have lost faith and confidence in Vaughan Gething".
Jane Dodds, Welsh Liberal Democrat leader and the party's only politician in the Senedd, said: "Any attempts of holding onto power would go against the established norms of our parliamentary democracy."
Mr Gething replaced Mark Drakeford as Wales’ first minister in March, defeating Jeremy Miles in a Welsh Labour leadership contest.
Since then, he has faced criticism – including from those in his own party – over the donations, while also being questioned over Covid-era text messages and the sacking of a minister for allegedly leaking information to the media, which she denies.
The result will also be uncomfortable for the UK Labour Party in Westminster, less than a month ahead of a general election.
During the debate leading up to the vote, Mr Gething was in tears as Labour members defended him, later saying he regretted a motion "designed to question my integrity”.
"Like so many of you in this chamber, I have dedicated my adult life to public services and to Wales," he said.
"Even in the midst of an election campaign, it does hurt deeply when my intentions are questioned."
He said he would "not shy away from scrutiny and challenge".
The first minister said that he and "so many people of colour have been traduced and vilified merely for raising concerns about how some of these debates have been handled".
"I will continue to put Wales first, first in thought, deed and ambition, as I serve and lead my country," he added.
'Not a gimmick'
Opening the debate, earlier, Mr Davies rejected Labour accusations that the no confidence motion he was bringing was a “gimmick”.
"This is a motion put down in opposition time that might well not be binding, but will send a significant message on the transparency, the honesty and the judgement call of the first minister since he assumed office," he said.
"That is not a gimmick."
Mr ap Iorwerth was equally scathing.
"Taken together the first minister's lack of judgement, and contrition, along with a bunker mentality, when faced with indignation from all sides of the chamber and the Welsh public, I believe do not demonstrate the required skill set for the office of first minister."
But Vikki Howells, Cynon Valley, chair of the Labour Senedd group said the Conservatives would do "anything at all to try and shift the spotlight from their own record of abject failure" during the general election campaign.
"Vaughan Gething is the democratically elected leader of Welsh Labour. Welsh Labour is the democratically elected party of government," she said.
"I believe it would be a travesty if this non-binding Tory gimmick of a motion was to be used to subvert democracy."
Who are Hannah Blythyn and Lee Waters?
The absence of Hannah Blythyn and Lee Waters from the vote raised eyebrows, given the two politicians' personal history with Mr Gething.
Ms Blythyn has not been seen in the Senedd since she was sacked by Mr Gething for allegedly leaking text messages to the website Nation.Cymru.
The message showed Mr Gething had told other ministers he was deleting messages from a group chat during the pandemic.
She denied she ever leaked to the media.
Mr Waters has been a vocal critic of Mr Gething's receipt of £200,000 from a controversial waste company - making a public intervention in the Senedd itself in May.
Neither politician has commented to the media on the vote.
Prior to the no confidence vote, UK Labour leader Sir Keir Starmer played down its importance.
Speaking to journalists, Sir Keir said: "I think it's really important to see this for what it is.
"It's game-playing by the Conservatives, with Plaid playing along as well.
"I think people in Wales want him to deliver for them.
"He wants to get on to deliver for the people of Wales."