The President wanted to go to the trenches. He walked through the mud for half an hour in his helmet, surrounded by generals and guards, and insisted they continue. The group could see the start of the Russian positions on the far side of the power lines. Volodymyr Zelensky refused to stop.

The commander in chief asked one of his generals to tell the group to turn back. Zelensky looked in my direction and continued hiking through the brush.

I wondered if this was an act. We met for the first time backstage at Zelensky's comedy show during his campaign for the presidency of Ukraine. He described the presidential headquarters as a gilded fortress he wanted to escape from. The first time I saw him with his troops was when he was playing the part of the generalissimo. It wasn't convincing.

The danger was real. By the time Zelensky came to power, the war between Russia and Ukraine had been going on for more than five years. The death toll was over 12,000, with almost nightly shooting or shelling across the front lines. No one knew that the war would get worse. Zelensky was aware that the Russian troops were massing on the other side of the border.

He told me at the end of the trip that they wanted the West to be afraid of Russia. Zelensky admitted that the threat of an invasion scared him, though he understood that showing his fear would play into Russia's hands.

Time interviewed Volodymyr Zelensky on Russia.

In the early morning hours of February 24, Russia put that plan into effect. Putin ordered his troops to oust the first Jewish President in its history and install a regime loyal to Russia in his place. Zelensky was thrust into a different role after the invasion, one that seemed ill-suited to his character. Zelensky has thin skin according to his friends and advisers. He suffers from the actor's condition of needing to be liked and applauded.

As the Russian bombs began to fall on Ukrainian cities, the President underwent a transformation. He came to embody a struggle that most Western statesmen had forgotten how to fight, the one that is sometimes required to keep tyranny from killing off democracy. Zelensky inspired his own people to throw petrol bombs at Russian military vehicles and stand in the way of tanks in order to defend their nation. He galvanized the world's democracies in ways that seemed unthinkable a week before.

The change wasn't instantaneous. Two days after the invasion, Western leaders met to agree on a package of sanctions to punish Russia. Germany, Hungary, and Italy initially wanted to water down the measures. Zelensky called to their meeting. He told the leaders of the free world that this might be their last chance to see him alive.

Zelensky's decision to stay in his capital has already changed the course of history. It caused the U.S. and its allies to impose unprecedented penalties against Russia, which caused the ruble to crash and much of its economy to be cut off from the rest of the world. Germany decided to pour more than $100 billion into its military, casting aside a postwar tradition of pacifism that has long frustrated allies. Switzerland supported sanctions, breaking from its tradition of neutrality. The E.U. agreed to put Ukraine on a path to membership.

Zelensky spoke via video link to the European Parliament on the sixth day of the invasion. Life will win over death and light will win over darkness if you prove you are Europeans.

Zelensky spends his days underground, in a basement and in a secret location, often on social media, to raise the nation's spirits. He shared a meal with his troops in one video message, which included bread with salami, sprats, and instant coffee. The people who surround him are mostly old friends, the ones who followed him through the world of show business, into the presidency and now to war.

The future President was born in the shadow of the biggest steel mill in the country. His parents spoke Russian at home. The family suffered a lot during World War II. Zelensky's grandfather, who commanded an infantry platoon in the Red Army, lost his father and three brothers in the Holocaust.

Zelensky's hometown became a "city of bandits" after the fall of the Soviet Union. He joined a sketch-comedy troupe at 17 to stay off the streets. The troupe formed a production company called Kvartal 95, after the neighborhood where they grew up.

The offices of Kvartal 95 are located on the top three floors of a high-rise near the center of the city. The walls are covered in posters for the movies they produced, mostly romantic comedies with the future President in the starring roles. Zelensky's voice was used in the Ukrainian version of Paddington. He was a contestant on the Ukrainian version of Dancing With the Stars and a producer.

He had a sitcom called Servant of the People that aired in 2015. Zelensky played a high school history teacher in a show that was based on a crazy premise: he uncorks an epic rant against corruption, which one of his students films and posts on the internet. Voters install a teacher as the nation's President after the clip goes viral on the eve of an election.

The show was a sensation in both Russia and Ukraine, and in the year 2019, it became Zelensky's platform into politics. He stood next to a Christmas tree on New Year's Eve and announced his intention to run for president of Ukraine. Zelensky's campaign was popular because he did not take part in debates or publish an electoral platform. His comedy show was a mix of political satire and vaudeville that was not always in the best of taste. Zelensky pretended to play a Jewish folk song on the piano with his penis in one sketch. The biggest concert hall in the city was filled to capacity despite the high ticket prices. If Zelensky won, the troupe wondered what Cabinet positions they would get.

Zelensky had little interest in discussing politics or foreign affairs in his dressing room after the show. His production company had just wrapped up the third season of Servant of the People, in which Zelensky's character saves Ukraine from ruin. Zelensky told me that there was no way the others could compete with that.

He was correct. In the final round of voting, nearly three-quarters of the electorate voted for him. The region that tends to lean toward Russia was swept by his campaign. In May of this year, Zelensky's new political party took a majority in parliament, becoming the first in Ukrainian history to control both the legislature and the executive branch.

Zelensky's first priority was to bring peace with Russia. He faced an obstacle in his most important ally. Most of the $400 million in US aid to Ukraine was meant to shore up the nation's military. Donald Trump wanted the Ukrainians to legitimize his claims of corruption against Joe Biden, and he was using the military aid as leverage. Zelensky was asked by Trump to announce investigations into the bogus claims.

Zelensky's faith in Ukraine's foreign partners was damaged by the blackmail attempt. He was due to meet Putin a few days later. He was intent on doing whatever it took to avoid a larger war. He told me that the eastern regions of Russia were not worth the lives of Ukrainian soldiers. How many of them will die? Hundreds of thousands, and then an all-out war will start, and then across Europe.

The talks with Putin did not go well. Russia refused to give up control of the east Ukrainian regions and the government in Kyiv refused to grant them the autonomy they wanted. Zelensky couldn't get vaccine supplies from his allies in the West because of the COVID-19 Pandemic. He wouldn't accept an offer from Putin to give Ukraine Russian-made vaccines, which it saw as a weapon in Moscow's information war. Many voters felt different. Public support for Zelensky dropped as low as 20% in some surveys by the end of 2020.

Putin wants revenge on the U.S. and its allies.

Pro-Russian politicians and other domestic opponents were the focus of the Ukrainian government. The leader of the biggest opposition party in the Ukrainian parliament was the first target of the purge. The assets of Medvedchuk's family were seized by the state and he was placed under house arrest. Zelensky's closest allies were not happy with the decision.

Putin was angry about the purge of the political field and sent thousands of Russian troops to the border. There was increased fire along the front lines. The U.S. began to warn of an invasion.

Zelensky tried to project a sense of calm. He spent nearly an hour talking to the troops inside a system of trenches they had nicknamed Vietnam, a nod to the mud and morass of a war they had seen in the movies. The President was taken to the place where three of his soldiers had been killed in an ambush by the top commander of the armed forces.

Zelensky did not promise to avenge them. He questioned the wisdom of sacrificing soldiers in defense of these muddy dugouts. The year before Zelensky was elected, Ukraine had seized that bit of ground in a violent push. He said the lives of his soldiers were more important to him than the terrain.

His foil in the Kremlin disagreed with him. The number of Russian troops on the borders of Ukranian increased by early winter. The warnings from the U.S. government began to get worse around Halloween. The US tried to convince Zelensky's team that a Russian invasion was imminent. The adviser says that the Americans backed up their estimates with satellite imagery of Russian hardware at the border, as well as intercept communications that suggested Russia was preparing to invade.

Zelensky and his inner circle did not believe in an invasion. The chances of a full-scale attack were not much higher than they had been since the war started.

The story of the Ukraine crisis is untold.

In the early morning of February 24, both Putin and Zelensky appeared on TV in their respective countries to deliver their final speeches before the invasion began. The contrast between them was stark. The address dripped with menace and his claims against Ukraine were detached from reality. He said he had ordered a special military operation to de-Naziize the entire country. It was a promise to destroy the armed forces of Russia and oust the government. It will lead to consequences of the sort that you have not faced before in your history.

Zelensky spoke directly to the Russian people. He told them he tried to reach Putin that day, but the Kremlin ignored him. He tried to counteract the propaganda coming from Russian state TV. He said that the people of Ukraine are free.

The Russian assault began with a series of rockets. In an attempt to overrun the capital, troops poured over the border from multiple directions. Zelensky was in the presidential headquarters with his team. His chief of staff remembers that as a moment of clarity. They attacked us. We are defending. Truth is on our side.

Zelensky's stagecraft turned into a powerful weapon in the information war. As Russia spread lies about neo-Nazis using children in Ukraine as human shields, Zelensky countered with a flurry of posts on social media, letting his people hear the earnest, grainy voice they had come to know from his movies. Zelensky was near them, and he refused an offer from the US to be evacuated to safer ground.

The President stayed in the government quarter. He did not wear a bulletproof vest. I had met him and his staff at the beginning of his tenure, in the same rooms with their indigo carpets and heavy chandeliers, and I saw him in a T-shirt as he led his besieged nation. The floors were heaped with sand and soldiers stood around, forming a weak defense against the Russian bombs that fell nearby.

Zelensky's team received images of devastation from across the country, including a missile hitting the TV tower in Kyiv and another landing in the east. There was news of Ukrainians standing their ground, destroying columns of armored Russian vehicles, capturing tanks and prisoners of war every time there was a Russian barrage. Military experts realized that Putin had underestimated both the will and the ability of Ukrainians to resist. A senior U.S. defense official said that the U.S. intelligence assesses that the Russian soldiers are not happy.

Zelensky sent a few of his men to an initial round of peace talks with Putin's men on the fourth day of the invasion. They agreed to keep talking even though the Kremlin was still demanding. Putin ordered his generals to put Russia's nuclear forces on high alert as aid poured into Ukraine.

Zelensky appeared before a camera in the government compound on the last day of February to sign his application to join the European Union. I'm sure it's possible after nearly two decades of talks with the EU. The president of the European Commission, Ursula von der Leyen, told reporters the same day that they want Ukraine to join the European Union.

At the end of the first week of the war, a 40-mile column of Russian military hardware began to form around the city. Zelensky's advisers assured me that spirits were still high. The existence of our state is very important. The Prime Ministers of Japan, Norway, and Israel all called the President to offer their support.

With every new promise of aid and prayer, the leader of the country seemed to forget their roles as victims of aggression. They were examples of the kind of strength we hope we can muster when called. There is no way to tell if we have that kind of courage until we need it the most. Zelensky may have had that moment on the second night of the invasion. He walked outside his office and filmed a message on his phone, surrounded by his aides.

Alejandro de la Garza, W.J. Hennigan, Nik Popli, and Simmone Shah reported.

We can be reached at letters@time.com.