The world's first democratically-elected communist government was formed in San Marino which is a microstate surrounded by Italy. The leftist government, which held office between 1945 and 1957, was a coalition of the Sammarinese Communist Party and the Sammarinese Socialist Party.

San Marino, officially called the Republic of San Marino, is situated on the Italian Peninsula on the northeastern side of the Apennine Mountains. San Marino, which has the smallest population of all the members of the Council of Europe, claims to be the oldest state in Europe and the third smallest country in Europe, compared to the Vatican and Monaco. Landlocked San Marino is described as “an echo from an era when city-states proliferated across Europe”.

The Kerala state in India was the second place in the world where the Communist Party came to power through open elections in 1957. But it was Salvador Allende, the president of Chile from 1970 to 1973, who was the first Marxist ever to be elected to the national presidency of a democracy.

More Info: en.wikipedia.org