Freemasonry in Spain () is first recorded in 1728, in an English lodge. As various papal bulls condemned Freemasonry the Spanish Inquisition did their best to close lodges and demonise Freemasons, therefore the success of Freemasonry from year to year depended on the sympathy or antipathy of the ruling regime. Nevertheless, lodges and even Grand Lodges were formed, and even thrived during more liberal periods. When Francisco Franco consolidated power in 1939, all Freemasonry was banned. In 1979, four years after Franco's death, bans on Freemasonry were declared unconstitutional, and several Grand Lodges and Orients now flourish in Spain.

History Early Lodges

On 15 February 1728, a Lodge named La Matritense or Las Tres Flores de Lys, probably after the name of the hotel in which it met, was formed on the Via San Bernardo in Madrid. It met in the apartments of a Past Grand Master of England, the Duke of Wharton, with Charles de Labelye as Master. This lodge was granted a Warrant by the Grand Lodge of England on 29 March 1729, the Lodge being placed on the Roll as .The history and the persecutions of Spanish Freemasonry - Martin I.McGregor, Grand Lecturer, Freemasons New Zealand - hosted on Pietre Stones Review of Freemasonry web site.La Matritense No 7, Historia (Parte 2), accessed 5 September 2014

In the same year, 1728, the Lodge of St. John of Jerusalem was constituted at Gibraltar and later placed on the Roll of the Grand Lodge of England as . In 1731, Captain James Cummerford, then serving with the British Army in Gibraltar, was appointed Provincial Grand Master for Andalusia, by which was meant Gibraltar and adjacent places. Gibraltar had been, since 1713, under British control and this Provincial Grand Lodge of Andalusia went on to form lodges throughout southern Spain.

Initially, the membership of Masonic Lodges in Spain consisted of expatriates from Britain and France, but it was not long before Spaniards began to join. In spite of this, for most of the eighteenth century no organized and stable masonry arose in Spain. The few lodges that were founded had a brief and precarious life because the Spanish Inquisition were quick to prosecute, enforcing the papal bulls and the decree of Fernando VI on 2 July 1751 banning Freemasonry. For example, the military lodge founded in Barcelona in 1748 that had begun in Nice was denounced to the Inquisition just two years later and closed down. It was reorganized in 1776, but again the Inquisition stamped it out and arrested all its leaders.Pere Sánchez Ferré, La maçoneria a Catalunya (in Catalan), L'Avenç 76, 1984, pp. 53-61.

In 1767, a Grand Lodge of Spain (Gran Logia Española) was formed, and Spanish Freemasonry declared itself independent from England. The first Grand Master was the Count of Aranda, Prime Minister of Charles III. In 1780, the name of this body was changed to the Gran Oriente Espanola, and it adopted the French system. It is known that many of the ministers of Charles III were Freemasons along with an impressive list of prominent Spanish nobles and high officials. In 1800, under the direction of the successor of Aranda, the Count of Montijo, the Grand Orient had 400 lodges.José María Arribas Macho, Masonería, Enciclopedia de Historia de España. V. Diccionario temático, ed Miguel Artola, Alianza Editorial, Madrid, 1991, p785

Condemnation and persecution As Freemasonry grew in Spain, it aroused the suspicions and hostility of both the Church and the secular authorities. On 28 April 1738, Pope Clement issued In eminenti apostolatus, condemning Freemasonry and forbidding Catholics from joining. In Spain, the encyclical received the royal exequatur and the Inquisitor-general published an edict dated 11 October 1738, claiming exclusive jurisdiction on the matter and called for denunciations within six days under pain of excommunication and a fine of 200 ducats.

In 1752, a year after the promulgation of the Royal Decree which outlawed Freemasonry, Franciscan Father José Torrubia published A Guard against Freemasons (Centinela contra francmasones), a collection of anti-Masonic foreign texts. Freemasonry was anathema to Spanish Catholicism, and became associated with terms such as "heresy", "Jewish", "atheist", "Jansenist" and "Manichaean". The frequent use of these words to refer to the Masons explains why it was not until 1843 that the term Freemasonry appeared in the Dictionary of the Royal Spanish Academy as "secret association, in which several symbols taken from the masonry, such as squares, levels, etc are used."Augustine Martinez de las Heras, Diccionario político y social del siglo XIX español, Madrid, 2003, p440-441, Masonry

Reign of Ferdinand VII (1808–1833)

With the invasion of the Napoleonic troops in 1808 lodges appeared which were instruments of Napoleonic policy. Barcelona had six, one of which was significantly called "Faithful Friends of Napoleon", and were mainly composed of military Frenchmen. This kind of Bonapartist Freemasonry disappeared when French troops left the country in 1813

As well as lodges supporting the "French" monarchy of Joseph Bonaparte in Spain, there were also "Patriot" Lodges which did not recognize the abdication of Bayonne and therefore still regarded Ferdinand VII as their rightful king. Anti-Masonic newspapers arose such as the Sun of Cádiz (1812–1813) which stated that, "A pernicious caste of men has spread all over Spain, who want nothing more than the subversion of the state and suppression of religion". Another myth arose concerning the Mason's nocturnal activities. An article published in 1812 contains the warning, "People of Málaga, flee these predatory evening wolves." The 18th century antimasonic diatribe continued unchanged.

After the 1814 restoration of absolute monarchy by Ferdinand, persecution of Freemasonry by the Spanish Inquisition reached its peak.The new Grand Inquisitor, Bishop Mier y Campillo, one of whose obsessions was Freemasonry, issued two edicts in early 1815 following the directives of the Holy See. Mier accused Masons of plotting "not only against thrones, but greatly against religion" and encouraged people to betray them, guaranteeing anonymity. The confiscation of the property of Freemasons was also included. There were many complaints, some false, and confessions, which led to the closure of lodges. Foreign Masons were expelled from Spain and the Spaniards were forced to undergo spiritual exercises. However, there were Masons who did not receive such lenient treatment. Such was the case of the liberal military officer Juan Van Halen. In 1817 he was tortured for two days after being arrested by the Inquisition. Van Halen's own account of the experience, narrated ten years later, is examined in Pío Baroja's book Juan van Halen, the adventurous official (Juan van Halen, el oficial aventurero) Emilio La Parra López &, María Ángeles Casado, La Inquisición en España. Agonía y abolición, Los Libros de la Catarata, 2013, pp. 146–147

The lists of suspected Masons then made (many kept by the king) were a useful tool in the hands of powerful politicians to get rid of opponents, many of whom may not have been Freemasons, according to Emilio La Parra and Maria Angeles Casado.

Freemasonry reappears in the Liberal Triennium, and develops a political role. It was repressed again during the Ominous Decade. In 1824 Fernando VII enacted a Royal Charter prohibiting "In the domains of Spain and the Indies, all congregations of Freemasons, rebels (Sp:communeros) and other secret sects."

The height to which the anti-Masonic paranoia could rise is illustrated by "Notions about Freemasonry" a little book published in 1828 that states;

Reign of Isabel II (1833–1868) In 1834 the regency of María Cristina de Borbón decreed an amnesty for Freemasons but maintained the ban on Freemasonry. Shortly after this the National Grand Orient of Spain was founded in Lisbon and in 1839 the Sovereign Departmental Chapter in Barcelona, dependent on the Grand Orient.

During this period Freemasonry remained hidden, which did not prevent it from gaining momentum during the Progressivist biennium (1854–1856), especially in Cuba, where some Masonic lodges participated in the independence movement, as had happened when the American colonies were emancipated from Spain between 1810 and 1825

Six years of Democracy (1868–1874)

Freemasonry expanded during the Six years of Democracy. Although lodges proliferated, taking advantage of the freedom proclaimed by the revolution of 1868, conflicts arose between the two allegiances, the National Grand Orient of Spain and the Grand Orient of Spain. The latter was more democratic and counted Manuel Ruiz Zorrilla as Grand Master. One of the most prominent politicians of his day, he was prime minister in 1872-1873 during the reign of Amadeo I. In 1876 he replaced Práxedes Mateo Sagasta, another prominent politician of the time and one of the pillars, along with Canovas del Castillo, of the Bourbon Restoration in Spain. That same year, 1876 a Senator, the Marquis de Seoane emerged to lead the conservative National Grand Orient of Spain.

During this period Masons could come forward and express their views publicly. The May 1, 1871 the "Official Bulletin of the Grand Orient of Spain" began to publish, and the following year Masonic Pocket Dictionary of Pertusa was published. In the latter work it was said that Freemasonry was an association of free men of good character, which has the sole and exclusive purpose of social betterment of mankind.

According to Pere Sánchez, "This was a masonry with a very thinly veiled political vocation in which not a few characters used its structure and their influence to climb to power and prestige within it, which (it is fair to say) met no opposition if the politician in question would favour their interests. It is no exaggeration to say that some of them would complete the 33 degrees (of the Scottish Rite) in three days and many others, who held important positions, hardly knew anything about the Freemasonry and did not attend rituals. Progressive ideology and bourgeois membership was then the prototype of Latin Freemasonry, which had quite different characteristics from Anglo Freemasonry, such as militant anticlericalism or supporting certain political revolutions. This Freemasonry, typical of Latin Europe, espoused positivism and universal suffrage in the second half of the nineteenth century, and some of these obediences even removed from their statutes the obligation to recognize the existence of the Great Architect of the Universe (God).

Anti-masonry also flourished during this period. Some expressed their dismay that "a charitable, moral institution of civilizing character" had to be "veiled in mystery" and concluded:

Bourbon Restoration (1875–1902)

The "golden age" of Spanish Freemasonry which began in the "Six years" lasted through the Bourbon Restoration. For example, in Barcelona where there were more than forty active lodges in 1890, various Masonic journals were published which raised money for charitable funds to would relieve the families of deceased Freemasons, helping in case of illness and providing a medical assistance. Founded in 1889 the Grand Orient of Spain, chaired by Miguel Morayta. In Catalonia hegemony was shared with Symbolic Grand Lodge of the Balearic Catalan Region, which supported Catalan nationalism. Created three years previously this was the first mainland obedience not to force its members to recognise the existence of the Great Architect of the Universe.