Suspected Basque separatist guerrillas almost sank a Spanish Navy destroyer today at dock in the northern port of Santander. It was the first bomb attack on a ship in the group's long-running effort to pull the northern region away from Spain.

Officials blamed members of Marxist ETA for the blast, which ripped a 10-foot gash through the hull of the 3,370-ton Marques de la Ensenada below the waterline. Despite extensive flooding, there were no casualties. Hours later the flooding was halted and the warship -- assigned to patrol duty off the Basque coast -- was judged safe against sinking.

Officials said the 5 a.m. explosion was caused by a powerful and sophisticated bomb placed by frogmen against the hull or strapped to an iron support of the jetty where the destroyer had berthed. Officials speculated that the sabotage marked a new phase in ETA's destabilizing campaign.

The ship is part of a six-vessel task force maintaining surveillance along the Basque coast since an attempted military coup in Spain last February.

In the wake of the putsch attempt, and clear evidence that the conservative service hierarchy was increasingly angered by Basque political violence, the government deployed troops along the Pyrennees mountain range to seal the border with France, traditionally a haven for ETA gunmen, and stepped up the Navy's presence in the Bay of Biscay.

Today's attack marked the end of a lull in political violence that had led to press speculation that ETA was maintaining a unilateral truce. The last significant ETA action was in May, when bombers in Madrid blasted the staff car of a senior military aide of King Juan Carlos.

According to Interior Ministry figures, ETA was responsible for 24 killings between January and June this year, compared to 44 for the same period in 1980.

The press speculation prompted a statement from ETA last month denying it had cut short its campaign for Basque independence and promising what it habitually terms "military" action in the near future. For the last three weeks, Army and police spotter helicopters have hovered over Madrid, and security forces have been on alert.

The attack on the destroyer seems to conform to the classic ETA strategy of provoking the armed forces into repression that could bolster its quest for an independent Marxist state among the Basques.