KUALA LUMPUR (Reuters) - Malaysia’s attorney-general cleared Prime Minister Najib Razak of any criminal offences or corruption on Tuesday, closing investigations into a murky multi-million-dollar funding scandal that his opponents had hoped would bring him down.

Najib was buffeted last year by allegations of graft and mismanagement at the debt-laden state fund 1Malaysia Development Berhad (1MDB) and by a revelation that about $681 million was deposited into his personal bank account.

But Attorney-General Mohamed Apandi Ali said the transfer was a gift from Saudi Arabia’s royal family, adding that no further action needed to be taken on the matter.

Najib, who denied any wrongdoing and said he did not take any money for personal gain, welcomed the attorney general’s statement.

“The findings followed a thorough investigation by the relevant institutions, and he has confirmed what I have maintained all along: that no crime was committed,” Najib said in a statement.

Opposition party leaders denounced the finding, saying the appointment of the attorney-general by the prime minister in the midst of the crisis suggested a conflict of interest.

But analysts said it was a victory for Najib that would allow him to focus on winning the next election in 2018.

“The AG’s statement today pretty much allows the government to move on ... As far as things are legally concerned, the prime minister is in the clear,” said Ibrahim Suffian, director of independent opinion polling firm Merdeka Center.

Although there were still a lot of people who would still be skeptical and critical of the government, he said.

Slideshow ( 6 images )

Apandi told a news conference no criminal offense had been committed by Najib in relation to three investigations submitted by Malaysia’s anti-graft agency.

“I am satisfied with the findings that the funds were not a form of graft or bribery,” he said.

“There was no reason given as to why the donation was made to PM Najib, that is between him and the Saudi family,” he said.

The involvement of the Saudi royal family is an unexpected twist in the saga over the funds transfer and the troubles of 1MDB, whose advisory board Najib chairs.

The Malaysian Anti-Corruption Commission (MACC) had earlier said only that the funds were a political donation from an unidentified Middle Eastern benefactor.

Apandi said $620 million was returned to the donor in August 2013, about five months after the transfer, because it had not been utilized.

He did not clarify what happened to the remaining $61 million that was not returned or explain why it had taken so long for news of the return of the funds to be released.

‘UNITE AND MOVE ON’

Slideshow ( 6 images )

Najib, the son of a former prime minister, enjoys the backing of most of the powerful division chiefs in the ruling United Malays National Organization (UMNO) party.

Even his fiercest internal critics, such as influential former Prime Minister Mahathir Mohamad, accept that he cannot be unseated.

Najib, who needs to build support ahead of the 2018 election, after scraping to only a narrow victory in the last polls, said the scandal had been “an unnecessary distraction”.

“Now that the matter has been comprehensively put to rest, it is time for us to unite and move on,” Najib said.

The scandal has shaken investors in Southeast Asia’s third-biggest economy and rocked confidence in the coalition led by UMNO, which has held power since independence in 1957.

The ringgit slumped by more than 20 percent in 2015 and has continued its slide this year, weighed down by global oil prices and political uncertainty.

“The attorney-general is satisfied with the findings, but it remains to be seen whether the public is satisfied and will put the 1MDB scandal to rest,” said Hak Bin Chua, ASEAN economist at Bank of America Merrill Lynch.

After the scandal broke in mid-2015, then attorney-general Abdul Gani Patail - who had led investigations of 1MDB - was replaced by Apandi, a former judge with strong ties to UMNO.

“The attorney-general should not have been involved in the decision affecting the PM because he was appointed by the PM,” said Lim Kit Siang, parliamentary leader of the opposition Democratic Action Party.

Two of the anti-corruption commission papers that Apandi reviewed related to SRC International, a former 1MDB subsidiary that is being investigated for an alleged misappropriation of funds.

1MDB is under investigation by law enforcement agencies in Switzerland, Hong Kong and the United States, media and other sources have said.