The crew of a ship on the southern Philippines sea has repelled a pirate attack using boiling water mixed with oil.

Twenty-seven sailors aboard the Philippines ship MV Kudos stopped 12 pirates trying to board the ship in the Basilan sea, by splashing the armed men with the concoction of hot water and oil.

This prompted the pirates to fire their guns, according to the Philippines Coast Guard.

Coast Guard Western Mindanao Command Chief Lieutenant General Carlito Galvez Jr said two crew members sustained minor injuries in the attack.

Lieutenant General Galvez Jr praised the courage of the sailors.

"We were pleased that the crew did not lose their presence of mind," he said in a statement.

"Their raw courage enabled them to pour hot water to the pirates who were already attempting to climb the vessel."

Coast Guard and Navy vessels rushed to the scene after receiving a distress signal, and escorted the ship to safety.

It was carrying steel bound for Manila from the southern Davao port when attacked.