The navy ship approached the Portuguese-flagged fishing boat, which was carrying 10–15 tonnes of hashish, on Sunday in the Mediterranean about 40 nautical miles south of the Spanish port of Almeria, the treasury ministry said in a statement.
"When it approached, the crew of the fishing boat set fire to a can of gasoline with the aim of setting fire to the ship and get rid of the drugs which they were transporting," the statement said.
Spanish customs agents on board the navy ship put out the fire, seized control of the fishing boat and detained its 10 crew members — five Portuguese, two Senegalese, a Spaniard, a Guinean and a Ghanaian.
Two crew members were injured and evacuated by the Spanish coast guard to a Spanish hospital.
Spanish authorities were tipped off to the possible presence of a fishing boat loaded with hashish in the Mediterranean by Portuguese police.
This was the eighth large seizure of hashish carried out by Spanish customs agents in the eastern Mediterranean since June 2013. Officials have seized over 100 tonnes of hashish in the eight operations.
Spain's proximity to north Africa, a major source of hashish, and its close ties with its former colonies in Latin America, a key cocaine-producing region, have made it the main gateway into Europe for narcotics.
Seizures of hashish declined by 2.4 percent in 2013 compared to the year before, to a total of 319 tonnes, according to interior ministry figures. Hashish seizures have been steadily decreasing since 2009.