The tenth siege of Gibraltar in 1506 was a minor military action in which the Duke of Medina Sidonia, Juan Alfonso Pérez de Guzmán tried but failed to recover the fortress of Gibraltar from the troops who were holding it in the name of the newly united crowns of Castile and Aragon.

Background
On 3 June 1469 King Henry IV of Castile made a gift of Gibraltar to Enrique de Guzmán, 2nd Duke of Medina Sidonia in return for the effort and expense that his  family had put into first capturing this fortress from the Moors and then arranging for settlers and a garrison.
On 30 September 1478 Henry IV's successors,
Ferdinand and Isabella, granted the Duke the title of Marquess of Gibraltar.

However, on 22 December 1501 a Royal Decree was issued that ordered Garcilaso de la Vega to assume Gibraltar for the King.
He traveled to the Rock where he formally took possession from the local authorities in early January 1502.
Ferdinand and Isabella granted the request of the people of Gibraltar for a coat of arms, which was designed as a Castle with a Golden Key pendant, the key representing the role of the castle in defending Spain.

Following the death of Isabella in 1504 the kingdom became unsettled.
Isabella was succeeded on the throne of Castile by their mentally unstable daughter Juana, whose husband was Philip, Archduke of Austria.
Ferdinand was appointed regent of Castile until Juana and Philip's son Charles, later to be Emperor, gained the age of majority.
Philip disputed the regency, but died in Burgos in 1506.
A council of Castilian nobles took control, since Juana would not do so, and eventually Ferdinand returned to Castile and assumed the regency in 1507.
Juan Alfonso Pérez de Guzmán, decided to forcibly re-assert his claim to Gibraltar during the power vacuum of 1506.

Siege
The Duke of Medina, who was in Seville,
sent instructions to his son Enrique to do what was needed to recover the fortress.
The Duke considered that Gibraltar rightfully belonged to his family, and expected that his friends in the fortress would arrange a surrender.
That did not happen.
News of the planned action quickly reached the people of Gibraltar, and all of them were enlisted in a force to defend the place.
The Captain-General of Granada, Íñigo López de Mendoza, the Conde de Tendilla, was asked for help.
It is significant of the recent shift in the power structure that the request went to a King's officer rather than a rival noble.

The "siege" lasted for four months, with Medina's forces trying to blockade the fortress rather than to storm it.
There was little fighting and no loss of life other than from disease. Giving up hope of success, the Duke yielded to the advice of the Archbishop of Seville.
He withdrew, paying compensation to the people in the area who had suffered damages from his forces.
Of the many sieges of Gibraltar, this was the only one that ended without bloodshed.

Aftermath
Juan de Guzmán stubbornly maintained his right to Gibraltar, asserting that King Philip I had restored it to him.
In June 1507 he returned to his stronghold of Seville, which he had left to avoid an outbreak of plague, determined to launch another siege.
Before he could act, on 10 July 1507 he died at the age of forty.

Ferdinand died in 1516 and was succeeded by his grandson, Juana's son, Charles.  In 1519 Charles became Holy Roman Emperor. Understanding the strategic importance of Gibraltar, he appointed Rodrigo Bazan civil and military commander of the Rock in 1520.
Under Bazan's long and peaceful rule, which lasted until 1535, the civil disturbances ended.  Buildings were repaired and new construction was undertaken.
However, the defenses were neglected, particularly those to the south.  The next threat to Gibraltar came from this direction, with a devastating attack in 1540 by one of the captains of the Turkish corsair Hayreddin Barbarossa.

Notes and references
Notes

Citations

Sources

Gibraltar
Sieges of Gibraltar
Gibraltar 1506
1506 in Europe
16th century in Gibraltar
1500s in Gibraltar