* Deals done with U.S. understanding - Sri Lanka govt spokesman
* U.S. denies any such agreement
* Some Iranian crude supplied via Malaysia - Sri Lanka govt spokesman
* Sri Lanka's sole refinery is configured for Iran light crude (Adds U.S. Embassy, Sri Lanka ministry comments, updates dateline)
COLOMBO, June 20 (Reuters) - The United States denied on Friday that it had any agreement with Sri Lanka to allow Colombo to import Iranian crude oil through third parties, avoiding Western sanctions aimed at curbing Iran's nuclear programme.
"We categorically deny there was any agreement," a spokesman at the U.S. Embassy in Colombo told Reuters.
Sri Lanka's Media Minister and government spokesman Keheliya Rambukwella told reporters late on Thursday that the island nation has been buying Iranian crude from various countries via third parties, and avoiding sanctions - with the understanding of the United States.
"For instance, Malaysia supplied what happened to be Iranian oil. It's a very closed secret," Rambukwella said during a briefing on the expansion of Sri Lanka's shipping fleet. "But we have had some understanding with the U.S. as well."
"I know the gravity of it. I know it's a serious statement," he said when asked if he was aware of the possible implications of what he was saying. He did not elaborate on the nature of the understanding between Sri Lanka and the U.S. government.
"Iran was supplying to 'X' place under a different name and from there to other places. Wherever there are sanctions, third parties are involved," Rambukwella added.
Asked how many cargoes of Iranian crude Sri Lanka had obtained through third parties, Rambukwella said, "I have no idea, but it was time to time. At the end of the day, you get the oil, and our refinery is meant for Iranian crude. They have a sulphur problem and other issues."
In a statement, Sri Lanka's External Affairs Ministry "categorically" rejected the contents of a Reuters article reporting Rambukwella's comments on Sri Lanka evading U.S. sanctions against Iran, saying it was "wholly incorrect and devoid of any truth."
A spokesman for Malaysian state oil firm Petronas declined to comment. A Petronas source, who didn't want to be named because of the sensitivity of the issue, said the company had been told by the Prime Minister's office not to deal in any business related to Iran. Malaysia stopped buying Iranian oil when Western sanctions were put in place in early 2012.
Sri Lanka's only oil refinery - a decades-old, 50,000 barrels-per-day (bpd) plant run by Ceylon Petroleum Corp (Ceypetco) - is configured to run on Iranian crude. The Sapugaskanda refinery, near Colombo, has faced closure at times as it scrambled to fill shortfalls due to sanctions on Iranian oil.
Sri Lanka has previously said that Western sanctions against Iran punish countries that depend on Iranian oil, but Colombo has sharply reduced its imports of Iranian crude to be eligible for waivers - concessions offered by Washington to avoid an energy crunch as a result of the sanctions.
Sri Lanka was twice granted waivers after the U.S. sanctions came into effect. It received a first waiver in June 2012 after cutting imports of Iranian crude by 23 percent.
But Sri Lanka was unable to buy any Iranian crude in the second half of 2012, largely because sanctions imposed on Iran by the European Union made it difficult to secure ships or insurance. With imports from Iran falling to zero in that period, government officials said they had been told by Washington that Sri Lanka would no longer be eligible to import from Iran. In June of last year, Sri Lanka's oil minister said it was unlikely the country would be granted another waiver.
Last November, the Sri Lankan government cancelled a shipment of crude after it was suspected of containing banned Iranian oil.
Sri Lanka has been importing Oman light and Murban crude from Abu Dhabi, but Ceypetco officials have said the yield at the refinery from processing these alternative crudes has been 15-20 percent lower than that from Iran light.
In exchange for a limited easing of sanctions, Iran agreed last November to take action to eliminate its most proliferation-prone enriched uranium gas stockpile and stop producing the material. (Additional reporting by Florence Tan in SINGAPORE; Editing by Jane Baird and Ian Geoghegan)