San Marino is not in Italy. It is a sovereign microstate entirely surrounded by Italy (an enclave). Founded 301 AD, it’s the world’s oldest surviving republic. It has its own government, laws, currency (euros by agreement), and UN seat. Italy handles defense/foreign affairs by treaty, but San Marino is fully independent.