fought against the Spanish forces. Although the threat from the powerful Spanish Navy existed, no major naval engagements occurred, the War being fought mainly on land. At the same time, Portugal made peace agreements with England, France and the Netherlands. In the period of the Restoration War, the major engagements of the Portuguese Navy were not against the Spanish but against the Dutch, that—despite having signed a peace agreement with the Portuguese—decided to take advantage of the difficult conditions caused by the war effort of Portugal in Europe and to assault and capture some of its colonies in America, Africa and Asia. Despite some important initial setbacks, the Portuguese were finally able to react, repulsing the Dutch assaults on Mozambique, Goa and Macau and recapturing Northeast Brazil, Angola, São Tomé and Ano Bom, in several naval and military campaigns. The 18th century During the reign of King John V of Portugal, the Navy suffers a large transformation, during which the warship starts to differentiate from the merchant ship. In 1705, a squadron of eight ships of the line was sent to help England against the Franco-Spanish forces that were besieging Gibraltar, this expedition culminating in the naval battle of Cabrita Point. At the request of the Republic of Venice and the Pope, in 1716, the Portuguese Navy sends a fleet to deter the Ottoman advance in the Mediterranean. This expedition would culminate in the battle of Matapan on 19 July 1717, in which the Portuguese fleet, supported by Venetian and Maltese ships, under the command of the Portuguese Admiral Count of Rio Grande, defeats the Ottoman Navy. From 1762 to 1777, the Portuguese naval forces based in Brazil participate in the several conflicts that occurred with the Spanish in South America, but with limited success. From 1770, under the leadership of D. Martinho de Melo e Castro, secretary of State of the Navy, the Portuguese Navy suffers a large reform and modernization. Incidentally, as part of these reformations, the old procedure of baptizing the Portuguese ships with names of Saints is replaced by their baptism with names of mythical, historical or Royal persons. The Royal Academy of the Midshipmen (Academia Real dos Guardas-Marinhas) was created in 1792, as a university-level naval academy. This Academy is the origin of the present Naval schools of Portugal and of Brazil. In 1792, the three naval regiments (two of infantry and one of artillery)