Ireland's deputy prime minister Frances Fitzgerald has said she is resigning for the sake of the country, averting a snap general election.
She had been under pressure over a police whistleblower scandal that could have brought down the government.
Taoiseach (Irish prime minister) Leo Varadkar said he had accepted her resignation with "deep regret".
She quit hours before a motion of no confidence in her was to be proposed by the main opposition party, Fianna Fáil.
There were fears that an Irish election could have complicated next month's EU meeting, at which the Republic of Ireland's position will influence the assessment of the UK's progress in Brexit talks.
According to Irish broadcaster, RTÉ, Ms Fitzgerald told a Cabinet meeting on Tuesday that she was not asked or forced to resign, but took the decision herself.
"I believe it is necessary to take this decision to avoid an unwelcome and potentially destabilising general election at this historically critical time," she said.
"Throughout my career I have always sought to act with integrity and responsibility, and that is why I have decided on this occasion to put the national interest ahead of my own personal reputation."
She had been under pressure to resign because of her inaction in supporting a Garda whistleblower, Sgt Maurice McCabe, whom she had publicly defended in her former role as Irish justice minister.
Ms Fitzgerald held the dual roles of tánaiste (Irish deputy prime minister) and minister for business, enterprise and innovation.
Speaking in the Dáil (Irish Parliament) on Tuesday, Mr Varadkar described her as an "exemplary member of government and a loyal colleague".
He defended her handling of the McCabe case and added that as minister she had enshrined a code of ethics in An Garda Síochána to protect officers who reported wrongdoing.
Mr Varadkar confirmed that he had accepted her resignation with deep regret and told the Dáil that a good woman was leaving office without getting a fair hearing.
"In the past few days a drip-drip of information may have made certain things seem greater than they are," he said.
"There was a feeding frenzy, and it became impossible for her to get a fair hearing based on the full facts."
The taoiseach added that he had advised the president to accept her resignation and he will personally take over her brief as minister for business, for a short time.
The taoiseach said he expects Ms Fitzgerald "to continue to play a full role in political and public life, including at the highest level into the future".
He described her as "one of the most reforming ministers we have ever had".
The Department of Justice's secretary general Noel Waters, who had been due to retire in February, said he was leaving the role on Tuesday.
Last week, it was revealed that Ms Fitzgerald had been told of an attempt to discredit Sgt Maurice McCabe by lawyers for the Garda commissioner at a commission of enquiry a year earlier than she had previously admitted.
She said she had forgotten the email and was precluded from acting on legal advice.
The publication of further emails on Monday showed she had been aware of the attempt to discredit the whistleblower on one other occasion and was seen by many in her Fine Gael party as undermining her position.
The Irish government is currently led by Mr Varadkar's Fine Gael party, but his cabinet includes a number of independent ministers and the coalition also depends on the support of the main opposition party, Fianna Fáil.
The coalition came to power in 2016, after a bruising general election in which no single party won enough seats to govern alone.
Fianna Fáil agreed to support the minority government for three budgets and in confidence motions, but the whistleblower controversy has tested that agreement.
If Fianna Fáil's proposed vote of no confidence in Ms Fitzgerald had passed, another election may have been unavoidable.