Full legal context
San Marino scores 28.52 % on the Rainbow Map, which puts the smallest country on this site ahead of Italy, the country that surrounds it on every side. The comparison is worth making in detail: San Marino scores 44 % for family against Italy's 17 %, and 46 % for hate crime and hate speech against Italy's zero.
Sex between men has been legal since 1864. Article 274 of the criminal code, in force from 1974, nevertheless punished habitual homosexual acts causing public scandal with between three months and a year in prison. No prosecution under it is recorded. It was repealed in September 2004.
What followed came quickly for a country of thirty-four thousand people. In April 2008 the Great and General Council outlawed discrimination and hate speech on grounds of sexual orientation, with effect from 3 May, and made the motive an aggravating circumstance in the criminal code. Civil unions were approved on 15 November 2018, took effect on 5 December that year and became fully operational on 11 February 2019, carrying residency, citizenship, pensions, healthcare, succession and stepchild adoption. Marriage and joint adoption remain closed.
The most unusual step was taken by the electorate. In November 2018 a proposal to add sexual orientation to Article 4 of the Declaration of Citizens' Rights, the country's basic law, won 35 votes in the Council where it needed 39, which under San Marino's rules sent it to a referendum instead of killing it. On 2 June 2019, 71.46 % voted yes. Equality before the law there now reads: without distinction of sex, sexual orientation, personal, economic, social, political and religious conditions.
In 2022 Paolo Rondelli, elected Captain Regent, became the first openly gay head of state in modern history.