The incident sparked environmental fears as well as concerns it could lead to yet another diplomatic row between London and Madrid, which wants Gibraltar back centuries after it was ceded to Britain in 1713.
The HMS Ambush submarine was submerged and carrying out a training exercise when it collided with an unspecified merchant vessel on Wednesday afternoon, damaging the front of its conning tower and forcing it to dock for checks in the overseas British territory on Spain's southern tip.
"The ministry has asked the British embassy in Madrid for urgent explanations over the extent of the breakdown and all relevant information regarding the circumstances of this incident," Spain's foreign ministry said in a statement.
Britain's navy tried to allay fears on Wednesday, saying there were "no safety concerns" as the collision had not damaged HMS Ambush's nuclear plant, adding that initial indications suggested the vessel had not been damaged.
But Antonio Muñoz, a spokesman for Spanish environmental group Ecologistas in Action, called for more information on the incident.
"We don't have any form of report to see if there was a radioactive leak," he said.
"We don't know exactly where the collision happened, where the other vessel is, whether the vessel that collided with the submarine was a freighter, an oil tanker... We don't know whether there was a leak from the vessel."
The incident revived memories of another submarine incident at the turn of the century, when Britain's HMS Tireless was forced to dock in Gibraltar for repairs for nearly a year after a crack was found in a cooling pipe near its nuclear reactor.
Its presence caused outrage in Gibraltar and southern Spain, which people staging regular protests, and strained ties between London and Madrid.
The tiny rocky outcrop of Gibraltar has long been the subject of an acrimonious sovereignty row between both countries.
Spain's conservative government, which has been in place since 2011, has been particularly vocal about its desire to see the territory come back into its fold.
In one particularly belligerent row over disputed waters, Spanish authorities upped checks at its land border with Gibraltar in 2013, creating hours-long logjams and forcing the European Commission to wade in and ease the crisis.
And there have been repeated incidents involving fishing or police patrol boats in disputed waters off the coast of Gibraltar.