"The submarine suffered some external damage but there is absolutely no damage to her nuclear plant and no member of the ship's company was injured in the incident," the ministry said in a statement.
"We are in contact with the merchant vessel and initial indications are that it has not sustained damage," it added.
The HMS Ambush submarine was submerged and carrying out a training exercise when it collided with the merchant vessel on today afternoon.
The HMS Ambush has the capacity to carry a mix of up to 38 Spearfish heavyweight torpedoes and Tomahawk land-attack cruise missiles, and can target enemy submarines, surface ships and land targets with pinpoint accuracy, according to the defence ministry's website.
More From This Section
The submarine is a regular visitor to Gibraltar, having stopped in the territory last month and in March.
The defence ministry said there "are no safety concerns" associated with the presence of the HMS Ambush in Gibraltar, and that it has opened an "immediate investigation" into the collision.
People in Gibraltar and in southern Spain staged regular protests against the HMS Tireless and it has been the subject of a high-profile direct action campaign by the environmental organisation Greenpeace.
Spain's prime minister at the time, Jose Maria Aznar, was criticised at home for not insisting that the submarine be moved back to Britain for repair.
The captain of the HMS Tireless at the time, Mike Walliker, assumed the post of Commander of British Forces in Gibraltar last week.
A tiny enclave located on Spain's southern tip, Gibraltar has been a British territory since 1713 and is known to its 30,000 residents as "the Rock".
Gibraltar remains a source of British-Spanish tensions, with Madrid long claiming the territory should be returned to Spanish sovereignty.