What comes to mind is Finland, though it doesn't meet all the criteria.
Finland gained its independence from the Russian Empire in 1917; it was a messy affair resulting from the collapse of Russia, and it wasn't clear who was in charge. A struggle for power quickly ensued and flared into civil war between the Reds and Whites.
The Grand Duchy of Finland was already semi-autonomous within the Russian Empire with its own Parliament. The Czar wasn't their Czar, he was their Duke and did not have absolute authority. From about 1908 to 1917 a process of "Russification" took place attempting to gain authority over Finland. The 1917 February Revolution in Russia put a stop to that.
That Parliament is what took up the reigns of power as the Russian Empire fell. The Parliament was composed of those who would later be Reds and Whites. The Reds were mostly consolidated under the Social Democrats. The Whites were a hodge-podge of the conservative Finnish Party, the Young Finnish Party, the centrist Agrarian League representing peasants and farmers, and the conservative Swedish People's Party representing the sizable Swedish-speaking minority.
In 1916 Social Democrats gained a majority, very rare in Finland, but didn't exploit it to push through a socialist agenda. Continuing turmoil in Russia lead to the dissolution of parliament in July and a power vacuum. The collapse of the Russian Empire meant a loss of aid and trade adding to the economic and political strain on Finland. With Russia in turmoil and Parliament disbanded, government institutions had collapsed including police and the military.
In October 1917 new elections were held and the Social Democrats lost their majority. This new Parliament was more polarized, and the October Revolution in Russia didn't help. The Social Democrats were split between moderates and revolutionaries. The moderates won the day in parliament, but revolutionaries saw this as a missed opportunity to push through their ideals legally, so they took to the streets.
In the confusion, armed groups began forming. The Whites had the Civil Guards, the Reds had Workers' Security. At first these were militia and security forces, but the presence of armed political factions and a weak government lead to increased tensions and more armament.
Very roughly, the Reds founded the Finnish Socialist Workers Republic encompassing most of rural southern Finland. They were socialists and communists backed by the Soviets. The Whites were a conglomeration of everyone else who opposed it and were backed by the Germans; they controlled the rural north and most of the major cities in the south.
The Whites had the military advantage: their German allies, not yet defeated in WWI; the help of the Swedes; the Jägers, who had fought with the Germans in WWI; and Carl Gustaf Mannerheim, former Lt. General under the Czar of Russia, also a veteran of WWI. This core of experienced troops and leaders would serve Finland through both the Civil War and WWII.
It was a short war, just three months, but bitter. Both sides committed atrocities, the Red and White Terror. Reds executed army officers, land owners, politicians, police officers, educators... the usual suspects of a communist revolution. The Whites executed captured soldiers and socialists. As the war quickly turned against the Reds, the White Terror accelerated in a political cleansing. That on top of the civilian casualties of fighting a civil war in Finland in winter. About 1,650 Whites and 10,000 Reds died in the Terrors.
Following the war, conditions in the POW camps were bad, not helped by a shortage of food. Out of 80,000 captured Red soldiers, 13,000 died in the camps.
The scar from this civil war would last for decades, but Finland went about patching itself up. Monarchists wanted a king and went so far as to elect Prince Friedrich Karl of the German Empire as King of Finland. He wasn't even crowned when the German Empire collapsed.
Finland found itself, sort of by accident of history, an independent Democratic Republic. They quickly adopted a constitution in 1919 based on moderate, pragmatic socialism with universal suffrage. In a few years, most of the Reds were pardoned and repatriated. Some would go on to hold key government and military posts. The scar of the civil war would last for another 20 years, but the Finns rebuilt their country. They established an eight-hour working day, and generally went about their business of hacking civilization out of the forest. Unlike other countries' struggles with the communist revolution at the time, Finland absorbed the best parts, and threw out the violence.
The Finnish political compromise went so well that when the Soviets invaded in 1939 expecting to be greeted by the Finnish people as liberators, they found few takers. Unlike the Soviets, the Finns had done very well for their people in the past 20 years.
Why did the White government adopt a Socialist constitution with universal suffrage?
This deserves its own question, but I'll take a stab at it.
There was a sort of madness that gripped Europe in 1918, and I believe the Finland was swept up in that. After decades of relative peace and stability, millions of people died in a senseless war on a scale the world had never seen. Not one, but four major empires, Germany, Russia, Ottoman, and Austria-Hungary, were swept away within a year. Without those empires to keep it down, long repressed nationalism was on the rise, while communism violently unraveled the established social, political, and economic order.
Right in the middle of this, Finland gained its independence in fits and starts. Being intimately connected to both Russia, the communist revolution in full swing next door would have consequences in Finland. Fortunately for Finland, its life as an autonomous duchy shielded it from the worst of the ravages of the Russian Empire. The socio-economic rifts were not so deep as elsewhere. There would be fewer scores to settle, fewer institutions to toggle.
Its war was mercifully short, in part because Finland is so sparsely populated, in part because the Whites had the lions share of military professionals. Soviet Russia had its hands full with its own civil war and did not seriously intervene. The Germans wanted Finland in its sphere of influence and did intervene, going so far as to take Helsinki for the Whites which probably shortened the war considerably.
With the war over, the madness passed. The Finns could watch the Russians next door tearing each other apart. Being a rough, northern country, they just couldn't spend the resources on a prolonged ideological war. With such a small population, about 3 million, it's difficult to get too radicalized; in contrast Russia was about 150 million and the US (at the time of its civil war) was 35 million. So the Finns went back to fighting the real enemy: the elements.
That's just an off-the-cuff answer, probably a bit romanticized.