Same-sex marriage in Spain has been legal since July 3, 2005. In 2004, the nation's newly elected Socialist government, led by President José Luis Rodríguez Zapatero, began a campaign for its legalization, including the right of adoption by same-sex couples.
After much debate, a law permitting same-sex marriage was passed by the Cortes Generales (Spain's bicameral parliament, composed of the Senate and the Congress of Deputies) on 30 June 2005 and published on 2 July 2005. Same-sex marriage became legal in Spain on Sunday, 3 July 2005, making it the third country in the world to do so, after the Netherlands and Belgium and 17 days ahead of Canada.
The ratification of this law was not devoid of conflict, despite support from 66% of the population. Roman Catholic authorities in particular were adamantly opposed, criticising what they regarded as the weakening of the meaning of marriage. Other associations expressed concern over the possibility of lesbians and gays adopting children. Demonstrations for and against the law drew thousands of people from all parts of Spain. After its approval, the conservative People's Party challenged the law in the Constitutional Court.
Approximately 4,500 same-sex couples married in Spain during the first year of the law. Shortly after the law was passed, questions arose about the legal status of marriage to non-Spaniards whose country did not permit same-sex marriage. A ruling from the Justice Ministry stated that the country's same-sex marriage law allows a Spanish citizen to marry a non-Spaniard regardless of whether that person's homeland recognizes the partnership. At least one partner must be a Spanish citizen in order to marry, although two non-Spaniards may marry if they both have legal residence in Spain.
During the 1990s and early 2000s, several city councils and autonomous communities had opened registers for civil unions that allowed benefits for unmarried couples of any sex, although the effect was mainly symbolic. Registries were created in 12 out of 17 of Spain's autonomous communities; Catalonia (1998), Aragon (1999), Navarre (2000), Valencia (2001), Balearic Islands (2001), Madrid (2001), Asturias (2002), Andalusia (2002), Extremadura (2003), Basque Country (2003), Canary Islands (2003) and Cantabria (2005).
Spanish law already allowed single people to adopt children; thus, a same-sex couple could undertake a de facto adoption, but the partner who was not the legal parent had no rights if the relationship ended or the legal parent died. Same-sex marriages were not legal in the autonomous communities, because the Spanish Constitution gives the State sole power to legislate marriage.
On 30 June 2004, the then Minister of Justice Juan Fernando López Aguilar announced that the Congress of Deputies had provisionally approved a government plan for legislation to extend the right of marriage to same-sex couples. This was to fulfil a promise made by Prime Minister José Luis Rodríguez Zapatero at his inauguration. López Aguilar also announced two propositions, introduced by the regional Convergència i Unió party of Catalonia: one introduced legal status for both opposite- and same-sex common-law unions (parejas de hecho, "de facto unions"), while the other permitted transgendered people to legally change their name and sex designation without the requirement of surgery.
The bill regarding same-sex marriage was approved by the Cabinet on 1 October 2004, submitted to Parliament on 31 December, and passed by the Congress of Deputies on 21 April 2005. However, it was rejected on 22 June 2005 by the Senate, where the opposition People's Party held a plurality of the seats. The bill was returned to the lower house, which holds the power to override the Senate, and final approval was given to the bill on 30 June 2005 with 187 "yes" votes, 147 "no" votes, and 4 abstentions.
With the final approval, and enactment of the bill on 2 July 2005, Spain became the third country in the world to formally legalize same-sex marriages nationwide, after the Netherlands and Belgium.
The first same-sex wedding took place eight days after the bill became law, and was celebrated in the council chamber in the Madrid suburb of Tres Cantos by Carlos Baturín and Emilio Menéndez. The first same-sex marriage between women took place in Barcelona eleven days later.
In spite of these steps toward equal treatment, a legal flaw remained: if children were born within a lesbian marriage, the non-biological mother was not legally regarded as a parent; she still had to undergo the lengthy financial process of adoption. This right was granted to heterosexual couples (married or not), where a stepfather could declare his wife's children to be his without further process. On 7 November 2006, the government amended the law on assisted reproduction, allowing the non-biological mother to be regarded as a parent alongside her female spouse who is the birth-mother.