The Philippines on Wednesday said it had postponed for a second time a decision to scrap a two-decade-old visiting forces agreement with the U.S.

The Philippines said it has decided to extend its agreement with the U.S. for another six months as the allies work on a long-term mutual defense pact, the Philippines' foreign ministry said Wednesday.

The change of heart by the Philippines government marks the second time it has suspended its decision to scrap the 20-year old agreement with the U.S. In extending the agreement, Philippine Foreign Secretary Teodoro Locsin Jr. cited the security provided by the agreement in the South China Sea.

The Philippines is a treaty ally of the U.S. with numerous military pacts reliant on the agreement. In 2019, President Rodrigo Duterte notified the U.S. that he was scrapping the agreement, which came in the wake of anger over a senator and ally being denied a U.S. visa.

Duterte ordered the six-month extension "to enable us to find a more enhanced, mutually beneficial, and more effective and lasting arrangement on how to move forward in our mutual defense," Reuters quoted Locsin as saying in a statement.

The U.S.-Philippines military accord, which is anchored on the 1951 Mutual Defense Treaty between the two countries, governs the conduct of U.S. troops in the Philippines while engaging in joint military exercises. With the extension, the agreement is considered effective until the first few months of next year.

Democratic president-elect Joe Biden will become president Jan. 20 placing his administration in charge of negotiations on the military agreement.

The agreement, which took effect in 1999 a year after the pact was signed, is critical to the U.S.-Philippines' decades-old military partnership and supports hundreds of joint military drills every year including disaster relief operations and ongoing anti-terror efforts.