Berlin (CNN)Earlier this week, Austrian Chancellor Sebastian Kurz met with German Chancellor Angela Merkel in Berlin, two generations of European conservative leadership standing side by side.
Austria's Sebastian Kurz, a rock star to conservatives, walks a 'thin red line' in Europe
Merkel, having just returned from the exhausting debacle of the G7 summit, talked about the "Herculean task" of keeping Europe united on immigration, finance and trade despite crumbling relations with US President Donald Trump.
Kurz, on the other hand, seemed energized, gearing up as Austria assumes the EU presidency next month.
''Our national focus will be security, with the goal of 'a Europe that protects'," he told reporters in a joint press conference. "In order to guarantee security in Europe, we need to strongly confront our defense policy in Europe. And we need a solution to our migration policy to secure the inner security of the EU.''
At 31, Kurz is one of the youngest world leaders, but he's also a seasoned political veteran with more than seven years of government under his belt. He shrewdly turned one of Europe's biggest crises -- the refugee influx of 2015 -- into a vote-getter at the ballot box.
As a rebellion within Merkel's government over immigration policy threatens to bring her 13-year rule to an end, Kurz's star is on the rise. And that's cause for celebration for conservatives on the right-wing end of the spectrum.
US Ambassador to Germany Richard Grenell, a close ally of US President Donald Trump, recently enthused over Kurz in an interview with Breitbart. "Look, I think Sebastian Kurz is a rock star," he said. "I'm a big fan."
Elected to the chancellorship in October, Kurz arrived in power just as Merkel's grip appeared to be weakening. He seems keen to dismantle at least some of what she has built and take the continent down a more hardline path, despite insisting regularly on his support for the European project.
Last year his party was the driving force behind a law banning full-face Muslim veils in public spaces, and last week he announced the expulsion of up to 60 foreign-funded imams and the closure of seven mosques in a crackdown on "political Islam."
He also seems keen to strengthen his country's links with Russia, meeting with President Vladimir Putin twice since coming to power in December. The Kremlin has also floated Vienna as a venue for a possible summer meeting between Putin and Trump.
Earlier in his career, Kurz was Austria's far more liberal minister of integration, a champion of "willkommenskultur" or "welcome culture" for immigrants. But as the country's foreign minister in 2015, he firmly opposed Merkel's decision to open Germany's doors to tens of thousands of refugees who marched through Austria to get there. Instead, he closed the borders and put a cap on the number of asylum seekers allowed to settle in Austria.
It was a sign of a shift to the right, but also a shrewd political move.
"He saw that the immigration policy of Merkel was going to have problems, and he realized that Austria had a strategic position to coordinate Balkan countries and close the border," explained Timo Lochocki, a political analyst writing a book on European political parties. "He signaled: I can close the borders. Even a small country can influence. That made him a conservative force to be reckoned with."
Merkel's decision to allow hundreds of thousands of refugees to settle in Germany was lauded by many at the time, but it has been politically costly and provided fodder for the far-right Alternative for Germany, which won 12.6% of the vote in last year's federal election and is now the official opposition party in the Bundestag.
If she is toppled next week by her own interior minister -- whose hardline "migration masterplan" is opposed by Merkel and is largely an attempt to win back voters lost to the AfD -- that too can ironically be traced back to her decision in September 2015.
Kurz's tough stance, meanwhile, endeared him to Austrian voters who had been looking for a leader to voice their fears about immigration. As a result, his revamped version of the conservative People's Party (OVP) handily won the most votes in last year's election.
But while Kurz had enough votes to become chancellor, he needed more seats to govern. So, he formed a controversial coalition with the far-right Freedom Party (FPO), which was founded by former Nazi officers. The FPO has more in common with the government of Viktor Orban in neighboring Hungary -- anti-immigration, pro-Russia and a thorn in the side of the European Union.
That alliance is a strength, as it frees Kurz from having to battle with an insurgent far-right party on every issue, but it is also "the biggest danger for him as chancellor," according to Austrian political analyst Thomas Hofer.
"There have been incidents of anti-Semitic quotes from the FPO, things said against (Hungarian Jewish businessman) George Soros, for example," Hofer said. "He condemned some of that on Twitter, called it out, but not in any big interviews. It's walking a thin red line for Mr. Kurz."
So far, Kurz has walked that line by being tough on immigration but also adamant in his support for the EU, seeming to differentiate his party from other anti-immigration political movements in Italy, Hungary and Poland.
"The Austrian electorate remains pro-European," Lochocki explained. "It may tilt to the right on immigration, but not on Europe and the EU. Kurz took a strategic stand on immigration but not against Europe."
In July, Kurz will be elevated once again as Austria takes on the rotating EU presidency. But it remains unclear which man -- the one who closes borders and expels imams or the one who champions European cooperation -- will lead Europe through the next months.
Perhaps that's because Kurz is happy to head wherever he sees votes to be won. He excels at recognizing a political opportunity, explains Cas Mudde, political scientist at the University of Georgia.
"He's applauded -- and criticized -- for his ability to read the mood and use a political opportunity for personal profit, irrespective of the ideological agenda."