Mr Hartzer will depart the bank on December 2, but has been given 12 months' notice and will be paid his full $2.7 million salary for the period.
However, his so-far unvested short and long-term bonuses will not be paid and he will not be eligible for any future bonuses.
Westpac was sued by the financial intelligence agency AUSTRAC, which last week applied to the Federal Court to issue fines against the bank.
Each breach could attract a civil penalty between $17 million and $21 million.
Mr Hartzer's abrupt departure follows pressure from all quarters in the wake of AUSTRAC's decision to pursue charges over the bank's deficient oversight of its anti-money laundering and terrorism financing obligations.
The breaches listed by AUSTRAC included the failure to adequately monitor the accounts of a convicted child sex offender who was regularly sending money to the Philippines.
While Mr Hartzer survived an emergency board meeting on Friday, pressure from political leaders and shareholders forced the bank's hand.
In a statement to the ASX released Tuesday morning, Westpac chairman Lindsay Maxsted said the board accepted the gravity of the issues raised by AUSTRAC.