Can same-sex sex committed in (e.g.) western countries be prosecuted in (e.g.) Morocco?
<p>Pretty much the title, is same-sex sex also illegal when not committed in a homophobic country when visiting there? E.g. could social media posts put you on trial when you'd visit such countries?</p>

<p>That depends entirely on the laws of the country involved. Some countries do make having homosexual relations a crime, indeed a very serious one. I haven't heard of one which prosecutes for being in a same-sex marriage or relationship entered into in another country, but such a country could hold such a trial if it chose to. Perhaps more likely, if a same-sex couple visited such a country, evidence of a continuing same-sex relationship might be treated as evidence of same-sex sexual acts, and thus of a crime under that country's laws.</p>

<h2>Yes</h2>
<p>I cannot speak specifically to Morrocon law but there are plenty of precedents for imposing domestic law on acts that happen outside the geographic jurisdiction of a state.</p>
<p>For example, every jurisdiction outlaws piracy, both the old-fashioned eyepatch and parrot type as well as the music download type.</p>
<p>Many countries also punish their own citizens and residents who travel for unlawful sex - usually with children but, in principle, there is no reason it couldn't be applied to any &quot;criminal&quot; act - homosexuality, adultery, pre-marital sex etc.</p>
<p>Of course, in Morocco, if homosexual acts are illegal, then they are illegal for everyone who is there irrespective of if they live there or are just visiting (diplomatic immunity excluded).</p>

<p>The relevant legal concept is &quot;extraterritorial jurisdiction&quot;, which is where a country asserts jurisdiction over acts performed outside its borders. An example is <a href="https://www.law.cornell.edu/uscode/text/18/2423" rel="nofollow noreferrer">18 USC 2423</a>, where a US person travels abroad to engage in any illicit sexual conduct – which is defined to cover sex with a person under age 18 with complications, but uncomplicatedly <em>any</em> commercial sex with a person under 18. However, prostitution is legal in a number of countries and the age of consent is under 18 in many countries (as low as 12). The act is legal in e.g. Thailand, but you can be prosecuted in the US (however, the US law limits prosecution to cases where the &quot;motivating purpose&quot; is illicit sexual conduct).</p>
<p>In Kenya, under the <a href="https://www.ilo.org/wcmsp5/groups/public/---ed_protect/---protrav/---ilo_aids/documents/legaldocument/wcms_127528.pdf" rel="nofollow noreferrer">Sex Offenses Act of 2006</a> §41(1) says</p>
<blockquote>
<p>A person who, while being a citizen of, or permanently residing in
Kenya, commits an act outside Kenya which act would constitute a
sexual offence had it been committed in Kenya, is guilty of such an
offence and is liable to the same penalty prescribed for such offence
under this Act.</p>
</blockquote>
<p>Under <a href="https://www.ilo.org/dyn/natlex/docs/ELECTRONIC/28595/115477/F-857725769/KEN28595.pdf" rel="nofollow noreferrer">Penal Code 162 and 165</a>, homosexual acts are felonies (the specific verbiage is &quot;carnal knowledge of any person against the order of nature&quot; and &quot;indecent practices between males&quot;).</p>
<p>Countries only claim extraterritorial jurisdiction for people that they have some legal control over, for example citizens and residents. A person who does not have the relevant legal connection to Kenya, who has outside of Kenya committed an act that would be illegal in Kenya, is not subject to prosecution in Kenya if they visit there (as long as they do not commit the act in Kenya).</p>

family-law