As Robin Hood, Kevin Costner stole from the rich to give to the poor. As an unnamed, be-gilled seafarer in Waterworld, he fought with outlaw "smokers" for a greater cause.

The actor's latest role, as saviour of the Gulf of Mexico, goes some way towards combining the two, after his oil-water separation machines, in which he has personally invested $20m (£13.5m), were contracted by BP to help in the Gulf clear-up effort.

Once separation has occurred, the oil is stored in tanks. The water is then more than 99% clean of crude.

"This is the key," Costner told CNN on Tuesday. "It's certainly a way to fight oil spills in the 21st century."

The actor has been developing the machinery since the early 1990s with the help of a team including his brother, a scientist.

"It may seem an unlikely scenario that I'm the one delivering this technology at this moment in time, but from where I'm sitting, it is equally inconceivable that these machines are not already in place," he said.

The actor gave testimony to the house of representatives science and technology committee last week, when he urged members to force oil rigs to have clean-up equipment on site.

"We legislated lifeboats and first aid kits. It seems logical that as long as the oil industry profits from the sea, they have the legal obligation to protect it, except when they find themselves fighting for life and limb."

BP spokesman Bill Salvin confirmed the company has contracted with Costner and Ocean Therapy Solutions to use the machines.

"We recognised they had potential and put them through testing, and that testing was done in shallow water and in very deep water and we were very pleased by the results," Salvin said.