The Goldman Sachs Group on Friday reached a nearly $4 billion agreement in principle with the government of Malaysia to resolve all criminal and regulatory proceedings in the country related to three bond transactions the firm had structured and arranged for the state development fund 1MDB.

1MDB was created by the government of Malaysia to promote economic development in the country through global partnerships and foreign direct investment, and its funds were intended to be used for improving the well-being of the Malaysian people. Instead, it has been the center of numerous scandals.

In 2018, Goldman Sachs disclosed it had received subpoenas and requests for documents and information from various governmental and regulatory bodies and self-regulatory organizations as part of investigations and reviews relating to financing transactions involving 1MDB. Goldman said at the time that “subsidiaries of the firm acted as arrangers or purchasers of approximately $6.5 billion of debt securities of 1MDB.”

The agreement in principle includes a cash payment of $2.5 billion and a guarantee of a full recovery value of at least $1.4 billion in assets that are traceable to the diverted proceeds from the three bond transactions. Goldman Sachs has also agreed to assist the government of Malaysia by appointing an asset recovery specialist to recover other related assets currently lying outside Malaysia.

“This settlement represents a significant increase compared to the previous offer of $1.75 billion made by Goldman Sachs to the previous administration in 2019,” the government of Malaysia stated. “With today’s settlement amount and the monies that Malaysia has already received from the U.S. Department of Justice, more than $4.5 billion will be returned to the people of Malaysia. The government remains committed to recover other outstanding assets.”

In a statement, Goldman Sachs said it was “pleased” to have reached an agreement. “Today’s settlement is an important step towards putting the 1MDB matter behind us and will help enable the Malaysian government to move forward with additional recovery efforts and to execute on its economic priorities,” the company said. “There are important lessons to be learned from this situation, and we must be self-critical to ensure that we only improve from the experience.”

The government of Malaysia agreed to withdraw the pending criminal charges and said no further charges would be brought against Goldman Sachs, its subsidiaries, or any of their directors, officers, and employees, excluding former employees Tim Leissner and Roger Ng, related to 1MDB. The agreement in principle does not resolve other pending governmental and regulatory investigations involving the firm relating to 1MDB.