SYDNEY/BENGALURU, Dec 3 (Reuters) - Westpac Banking Corp agreed to a court-backed undertaking with Australia's banking regulator on Thursday to address "long-standing weaknesses" in its risk controls and poor oversight.

The enforceable commitment follows two years during which Westpac failed to improve its risk governance, the regulator said, contributing to a lawsuit and fine for enabling millions of improper payments, including to people exploiting children.

In a statement, the Australian Prudential Regulation Authority (APRA) said it had concluded Westpac had "failed to deliver the expected risk governance improvements despite almost two years of remediation".

"This has undermined APRA's confidence in Westpac's ability to remediate these weaknesses in a timely manner."

The regulator had flagged the agreement on Tuesday, when it said Australia's No. 3 bank had breached capital requirements and therefore would have to increase the amount of cash it keeps on hand for liquidity purposes.

"We continue to observe new prudential issues arising while long-standing weaknesses persist, and we believe Westpac's governance, culture and accountability frameworks and practices are still in need of a substantial uplift," APRA Deputy Chair John Lonsdale said in the statement.

Westpac said the agreement will force it to develop and fund a plan to remediate its shortcomings with a clear timeline, have its progress reviewed each quarter by an independent third party, and integrate the delivery of such plan into remuneration metrics for executives.

The lender has 90 days to submit its plan to the regulator.

Shares in Westpac were 0.6% lower.

"Today's announcement once again highlights the ongoing issues facing Westpac which is having a sustained detrimental impact on returns," UBS analysts said in a note.

Chief Executive Peter King said his "top priority is to ensure the bank's risk culture and management of risk meet the high standards expected of us". ($1 = 1.3486 Australian dollars) (Editing by David Gregorio and Lincoln Feast.)