Catherine the Great was the longest-serving female ruler in Russian history. But before this Prussian-born princess could reign, she had to overcome a loveless marriage to an unstable heir that resulted in a power struggle that turned deadly.

Peter III was the grandson of two emperors

The future Peter III was born Karl Peter Ulrich in 1728, in Kiel, Germany. His mother was the daughter of Russia’s Peter the Great, and his father the nephew of Sweden’s Charles XII. Peter seemed destined to inherit the throne of Sweden, not Russia, and he was brought up as a Lutheran.

He was a middling student and weak-willed (though not as stupid as he was later depicted), whose intense dislike for traditional learning was equally balanced by his passion for all things military. He dreamed of becoming a great military leader and later emulated Frederick the Great of Prussia.

By age 11 Peter had been orphaned, and a few years later his future plans were upended when his childless maternal aunt, Russia’s Empress Elizabeth, chose him as her successor. He moved to Russia’s then-capital, St. Petersburg, where he took the name Peter (Pyotr) and was forced to give up his Lutheran faith and join the Russian Orthodox Church.

Catherine II of Russia had not a drop of Russian blood

Elizabeth quickly set to work on finding her new heir a suitable wife. Enter Sophie of Anhalt-Zerbst. She was the daughter of minor Prussian nobles who had more social connections than money. Her ambitious mother had groomed Sophie for an advantageous marriage, and in early 1744, when she was 14, Sophie and her mother traveled to Russia.

The bright, pretty, vivacious teen quickly charmed both the empress and the Russian people. But her second cousin Peter was not so enamored. The two teens had briefly met several years earlier and had taken an almost instant dislike to each other. Despite this and Sophie’s own father’s misgivings, a marriage was quickly arranged. Like Peter, Sophie took on a new religion and new name, Catherine (Ekaterina), and the couple wed in August 1745. Catherine was 16, Peter 17.

Catherine and Peter’s marriage was a disaster from the start

While many modern historians have presented a more favorable view of Peter, it’s Catherine’s depiction of him that prevails. Her letters and memoirs are filled with tales of his boorish, drunken and frequently cruel behavior (she would later allege that he had forced her to watch him hang and “execute” a mouse he found in their apartments).

He abandoned her on their wedding night to party with friends and things went downhill from there. An increasingly unhappy Catherine turned to reading, consuming books by Enlightenment authors like Voltaire. Unlike Peter (who remained steadfastly true to his non-Russian roots), she relished the language and religion of her adopted homeland, quickly becoming fluent in Russian. Peter, meanwhile, spent his time with soldiers — both toy and real — forming guards’ units that he ceaselessly trained.

Unsurprisingly, Peter and Catherine found solace in the arms of others. Catherine would later imply in her memoirs that the couple’s son Paul was fathered not by Peter, but by Catherine’s first lover, Sergei Saltykov (although his strong resemblance to Peter lead many to believe he was the boy’s father). Despite having his own mistress, Peter was enraged by rumors at court that the couple’s second child, a short-lived daughter named Anna, was not his. Catherine was also devastated when Elizabeth took control of Paul’s upbringing, allowing Catherine only brief, infrequent contact with her son.

READ MORE: Catherine the Great: The True Story Behind Her Real and Rumored Love Affairs

Peter ruled Russia for just 186 days

By the late 1750s, Elizabeth’s health had begun to decline. Though it was clear that her reign would soon end, she did little to prepare her heir, seemingly fearful of giving him a role in affairs of state. In January 1762 Elizabeth died, placing 33-year-old Peter on the throne.

Despite Prussia being Russia’s longtime enemy, he withdrew from the Seven Years’ War and threw his support behind Frederick the Great. He even dressed Russian troops in Prussian blue and began military reforms based on the Prussian model, deeply angering many army officers. His mistrust of the Russian Orthodox Church led to passage of a new law that promised religious freedom for Russians, which the Church saw as a slap in the face. He made the killing of serfs (peasants who were legally owned by their wealthy masters) illegal. And he outlawed Russia’s notorious secret police.

Peter was now ruler of all Russia, but he seemed determined to alienate many of Russia’s most powerful groups — the same groups that Catherine had spent more than a decade cultivating. By the time Peter became emperor, Catherine had begun an affair with a dashing artillery officer, Grigory Orlov. And she’d formed close ties with many in the Russian nobility and the Church. With Peter and his court ensconced at the royal residence of Oranienbaum on the Gulf of Finland, Catherine began consolidating her support in St. Petersburg.

The idea of a coup that placed a woman atop the Russian throne was not all that unusual. Elizabeth herself had seized power in 1741 with the help of the powerful, elite Preobrazhensky regiment. Things came to a head that summer when rumors began swirling, and Catherine becoming increasingly convinced that Peter planned to divorce her.

On July 8, Catherine learned that one of her co-conspirators had been arrested and she leapt into action (leaving her palace in such haste that he hairdresser had to tend to her coif as they traveled). After securing the support of the military, she had the Russian church crown her as the sole ruler of Russia. Peter was arrested later that day and forced to abdicate, ending his six-month reign.

Mystery continues to swirl over Peter’s death

Peter was exiled to Ropsha, 30 miles outside of St. Petersburg. Eight days later, he was dead. The official report concluded that he had died from severe hemorrhoids and an apoplexy stroke. But few inside or outside of Russia bought that. Some historians contend that he committed suicide or died in a drunken brawl with guards, but it’s largely believed that he was murdered by his captor Alexei Orlov, brother of Catherine’s lover Grigory.

Catherine’s complicity in Peter’s death remains a hotly debated topic and it’s uncertain if she knew of his likely fate when she seized the throne. She may have planned to offer him exile, but the quick political rise of the Orlov brothers and other co-conspirators cast doubt on that theory. Whether Catherine gave her implicit or explicit approval, Peter’s untimely death cast a pall over her early reign.

She would also face frequent challenges to the legitimacy of her claim to the throne by a series of “pretenders.” Eight years after Peter’s death, a Cossack-turned-outlaw named Yemelyan Pugachev gained support behind his fictitious claim that he was, in fact, a very undead Peter III. Catherine dealt with Pugachev’s rebellion as she would other uprisings, bringing the crushing power of the Russian army to bear. Pugachev was captured and executed, and Catherine would continue her attempts to transform Russia (for better and worse) during her 34-year reign.

Peter’s son met the same grisly fate as his father

Paul was just 8 years old when Peter died. Already estranged from Catherine in his childhood thanks to the Empress Elizabeth’s meddling, mother and son grew increasingly distant as Paul grew into adulthood, with Paul harboring doubts of his mother’s role in Peter’s death.

Although Catherine briefly considering replacing Paul in the line of succession with his eldest son, Alexander, he succeeded his mother after her death in 1796. He was his father’s son in nearly all things, including his obsession with the military and the Prussian way of life.

Upon assuming the throne, he threw himself into undoing nearly everything Catherine had achieved. His ineffective bumbling of Russian foreign policy left it politically isolated and on the brink of war. Harsh restrictions placed on the nobility and plans to dramatically reform parts of the Russian army proved deeply unpopular. He was also inconsistent and mercurial, with a fearsome temper.

Although many of his reforms were aimed at improving the lives of Russian’s lower classes, the ruling elite had had enough. In March 1801, less than five years after he became emperor and nearly 39 years after Catherine’s coup, Paul was murdered by a group of nobles. His son Alexander, who was in the palace at the time, knew of plans to overthrow his father — but as with Catherine and Peter, it remains unknown if their grandson knew he was sending his father to a certain death.