Just hours before a motion of no confidence was due to be held in Ms Fitzgerald, Mr Varadkar telephoned Mr Martin to confirm the decision, a Fianna Fail party source said.
John McDonnell: Brexit threatens to 'undermine the peace process' if Northern Ireland hard border installed
The move looks set to thwart a political crisis in Dublin, which would have cast a shadow over Brexit negotiations.
Mr Martin "has put huge personal effort into resolving this issue and averting a general election - and it looks like that may well have been achieved," Fianna Fáil finance spokesman Michael McGrath told RTE radio.
The parties met to hold last-minute talks to avoid a government collapse.
Fianna Fail wanted Ms Fitzgerald ousted over her involvement in a long-running police scandal, revolving around her knowledge of an aggressive legal strategy against a respected police officer during a private inquiry in 2015.
Mr Varadkar's Fine Gael party backed Ms Fitzgerald ahead of a motion of no-confidence due to be voted on tonight.
More about: #Ireland