PUTRAJAYA, Malaysia--Malaysia and Singapore agreed on Wednesday to delay, not cancel, a planned high-speed railway that would cut travel time between their capitals to just 90 minutes.

Shortly after a stunning election victory in May, new Malaysian Prime Minister Mahathir Mohamad said the 350-kilometer rail project would be axed because it was too costly.

But after weeks of negotiations, officials from the two countries signed an agreement Wednesday to defer construction of the rail link by two years to May 31, 2020. The two governments said the railway is now slated to begin operations by 2031 instead of 2026.

Mahathir's about-turn will help Malaysia avoid paying hefty compensation and buy time to improve government finances.

Economics Minister Azmin Ali said Malaysia will pay 15 million Singapore dollars ($10.9 million or 1.2 billion yen) to Singapore by January as a suspension cost. If the project isn't revived by the agreed date, Malaysia will have to bear the termination cost, he said, but declined to give details.

"The agreement signed today clearly stated our commitment to continue the project after 2020," Azmin told a news conference after signing the pact with Singapore Transport Minister Khaw Boon Wan. The signing was witnessed by Mahathir.

The two countries signed an agreement in December 2016 to build the rapid rail line with speeds of over 300 kph. It was dubbed a "game-changer" that would strengthen economic ties between the neighbors. Currently, it takes at least four hours to travel by car.

Khaw said Singapore agreed to Malaysia's request to put the project on hold to give its government time to manage its finances.

Mahathir's alliance won a stunning victory in May 9 elections to oust scandal-tainted former Prime Minister Najib Razak and end his coalition's 60-year grip on power.

The new government has begun reviewing large-scale infrastructure projects, including Chinese investments, to cut costs after revealing that national debt and liabilities had surged to 80 percent of gross domestic product, taking into account government guarantees and other payments.

The huge debt is partly due to a massive corruption scandal at the 1MDB state investment fund set up by Najib that led voters to abandon him and sparked investigations in the United States and several other countries. U.S. investigators say Najib's associates stole and laundered at least $4.5 billion from the fund.

Mahathir has reopened an investigation into 1MDB that was suppressed during Najib's rule and barred Najib and his wife from leaving the country.

Najib, who denies any wrongdoing, is facing multiple charges of money laundering and criminal breach of trust.