The Government has won a Dáil confidence vote in Minister for Justice Helen McEntee by 83 votes to 63.
The vote followed significant political pressure after the riots in Dublin last month.
A no-confidence motion in Ms McEntee was tabled by Sinn Féin, before the Government tabled a counter-motion expressing confidence in the minister.
Sinn Féin said that it no longer had confidence in Ms McEntee in the aftermath of the stabbing of young children and a carer in Dublin city centre and the subsequent street riots.
The Social Democrats had also expressed no confidence in the minister.
At the beginning of the Dáil debate on the confidence motion, Taoiseach Leo Varadkar said his thoughts were with the victims of the stabbings at Parnell Square.
He said he wanted to thank gardaí, council, transport and retail workers who responded to the riots. He said he had known Ms McEntee for 20 years and she was someone he turned to in "difficult times".
The Taoiseach added the minister was increasing garda numbers and introducing facial recognition technology to enable the reviewing of thousands of hours of CCTV footage, and free up garda time.
He said Minister McEntee was also working to crack down on the proceeds of organised crime and the number of gang-related murders had fallen significantly on her watch.
In relation to the riots, the Taoiseach said: "We also need to understand why some people reacted the way they did and to what extent the riots were orchestrated by subversive elements."
He added the riots did not reflect the views of people living Dublin city, as of the 48 people arrested only four were from Dublin 1. He said Sinn Féin's motion of no confidence was a "political stunt".
Removing a Minister for Justice would have been a victory for those organising violence on our streets, he said.
"It would embolden them to strike again," he told TDs
Sinn Féin leader Mary Lou McDonald said that in Dublin's north inner city, there is an "ever-present hum of menace, risk and an overriding lack of personal safety".
She told the Dáil that there is a "general feeling of lawlessness" and the response of Government has been "to skirt around the problem" or to "completely abandon these communities".
"Control of Dublin city centre was lost to a mob," she said, and the riot "was entirely predictable" and "openly orchestrated".
"Gardaí were left to organise themselves on WhatsApp," she said.
"I have full confidence in An Garda Síochána. I have zero confidence in the Minister for Justice," Ms McDonald added.
She denied that her party is politicising the issue, insisting that "there is nothing more political than keeping people safe".
Tánaiste Micheál Martin said that the no-confidence motion "is yet again solely about Sinn Féin pursuing its cynical and aggressive approach to opposition".
He accused Sinn Féin of "cynicism and aggression", which "puts electoral politics first in everything".
Mr Martin took aim at Ms McDonald, "one of the deputies for the north inner city".
"The Dáil record shows that, in the past three months in Leaders' Questions, she never once raised the violence she now says was obviously about to breakout," he said.
He criticised Sinn Féin TD Louise O'Reilly for calling for Ms McEntee to be taken out, and said that a party such as Sinn Féin making such calls must not be normalised.
Mr Martin condemned members of the opposition for "contributing to a dangerous atmosphere".
Labour TD Aodhán Ó Riordáin said Ms McEntee's failures are "cross-Government" and not hers alone.
He condemned the use of the word "scumbags" by the minister, saying that it had made the work of youth community workers harder.
Labour voted against the Government's counter-motion.
Earlier, Ms McEntee said she was happy that she has the support of her Government colleagues.
Speaking on her way into this morning's Cabinet meeting, Ms McEntee said the motion was a "distraction" and that she was getting on with her work.
Additional reporting Mícheál Lehane, Samantha Libreri