In a matter of a few days, Pedro Sánchez, the 46-year-old leader of Spain's Socialist party, has gone from unpopular-at-the-polls lawmaker to prime minister of the fourth-largest economy in the eurozone.
He was sworn in on June 2, after leading a no-confidence vote in parliament on May 31 that pushed out former Prime Minister Mariano Rajoy, as corruption allegations badly tainted the administration's center-right Popular Party.
Now, with little more than a month in office, Sánchez has wasted no time in trying to put the country on a new, more liberal course following 6 1/2 years under conservative Rajoy.
His agenda, so far, has included immigration and gender issues, as well as addressing a painful chapter under Gen. Francisco Franco's 1939-1975 dictatorship — which are "symbolic" themes for Spaniards, said Sandra León, an expert on Spanish politics at the University of York in England.
"These areas may be good because they are likely to gather public support and do not represent a budgetary liability," León said.
Sánchez's fast rise to the top of government came as a surprise to many in Spain. In 2016, he led the center-left Socialists to their worst election results in recent memory. He resigned as party leader not long after, only to be re-elected to the post by the party in May 2017.
Dubbed "Mr. Handsome" — by the English press, according to Spanish media, or by the Spanish themselves, according to some English papers — Sánchez brings a modern image to government. Rajoy was notoriously media-phobic and critics mocked his poor English skills. Sánchez, on the other hand, speaks the language fluently and has already been engaging in English-language pleasantries with Canadian Prime Minister Justin Trudeau on Twitter. When Trudeau congratulated him on becoming prime minister, Sánchez replied in English.
But Sánchez's position as prime minister is fragile. The Socialists have just 84 of the 350 seats in the lower parliament. He only managed to replace Rajoy with the help of smaller parties, including the leftist Podemos and Basque and Catalan nationalist groups. Sánchez will need to keep them on his team to get legislation passed. The now-opposition Popular Party, or PP, has 134 seats.
"Sánchez has engaged in a strong signaling game, trying to show he has the statesmanship qualities and also a progressive agenda that, despite the lack of parliamentary numbers to implement it, he will try to implement after the next elections," said Víctor Lapuente, a senior lecturer in political science at Sweden's Gothenburg University and frequent commentator in Spanish media.
On day five in office, Sánchez made history by appointing Spain's first government comprising more women than men. Eleven out of 17 cabinet posts, including at key ministries such as defense, finance, economy and the interior, are now held by women.
That's the highest share of women in any cabinet in the world, according to a UN Women report.
"It's a powerful message of gender equality sent to citizens and institutions," Emanuela Lombardo, a senior lecturer in political science with a focus on gender at Madrid's Complutense University, told NPR.
She praises the strides the new government has already made — including re-establishing the Ministry of Equality and appointing a feminist sociologist, Soledad Murillo, as secretary of state for equality.
But, Lombardo says, "the fact that the government is working with the budget approved by the former PP government," the party that holds a majority in the Senate, "will create hurdles" for further reforms.
On the European Union's southwestern frontier, the Spanish coast is an arrival point for thousands of migrants each year, making risky journeys to seek refuge in mainland Europe.
Sánchez is taking a principled stand on migration, in stark contrast to Europe's anti-migrant politicians, including new Italian Interior Minister Matteo Salvini.
In June, when Italy and Malta refused permission for a rescue ship carrying 629 migrants to dock, Sánchez stepped in and said the Aquarius was welcome in Spain.
The Spanish leader has been eager to work on a European-wide policies on migration.
His first EU summit, held late last month, was a marathon. EU leaders managed to come to an agreement in the early hours of June 29. The deal involves opening new centers in member countries that will be used to house and process asylum-seekers — a plan that was championed by both Sánchez and French President Emmanuel Macron. The centers will be opened on a voluntary basis but will be run and funded collectively by the EU.
"The EU is beginning to move in the right direction: to give a European perspective to a European challenge like migration," Sánchez tweeted.
While not comprehensive, the deal served as a compromise between "front-line" states like Spain and northern countries such as Germany.
Spain's southern coast is just 8 nautical miles from Morocco and thousands of migrants have been making the perilous journey across the Strait of Gibraltar in often barely seaworthy boats.
In June, over 6,000 migrants reached Spain's southern coast by sea, which is more than the number of migrants who arrived in Italy and Greece combined, according to the International Organization for Migration.
The issue of Catalonia, in northeastern Spain, became the biggest political crisis to hit Spain since its return to democracy in 1978.
In October 2017, Catalonia's government went ahead with a referendum on independence from Spain, which the central government in Madrid had deemed illegal. Spanish police cracked down forcefully on voters.
The Rajoy administration ended up taking over the regional government and imprisoning Catalan officials aligned with the independence movement. The Catalan regional president at the time, Carles Puigdemont, fled Spain for exile in Brussels.
More than seven months of Madrid's direct rule over the region ended on June 2 — the same day Sánchez took office. Catalonia's new government was sworn in under a new president, Quim Torra, a Catalan independence-minded leader with close ties to former President Puigdemont.
Last week, Sánchez moved jailed Catalan politicians from prisons near Madrid to ones in Barcelona, the capital of Catalonia, so they could be closer to their families and lawyers.
And on Monday, he met with new Catalan President Torra. Rajoy had refused to negotiate directly with Puigdemont.
Sánchez tweeted an upbeat message — in the Catalan language — saying "a political crisis requires a political solution. This meeting is a constructive start toward normalizing relations."
Many Spanish citizens are concerned by Catalonia's independence movement, but a poll in April for Barcelona's El Periódico newspaper found 47 percent of Spaniards support a referendum on independence as a way to ease tensions around the issue.
For many analysts, how Sánchez deals with the Catalan crisis could make or break him.
"I think it will be the most divisive issue, if not in the day-to-day news cycle, then in the long term," said sociologist Jorge Galindo, who writes regularly on politics in the Spanish media.
"It is possible that immigration will become a politically divisive issue in Spain, something that has not happened so far. But I think Sánchez's decisions regarding the Catalan conflict are more likely to deepen the already existing divisions among citizens," he added.
Moving the prisoners and meeting with Torra are steps toward reversing some of the previous government's actions toward Catalonia, suggesting Sánchez is more open to dialogue and compromise than Rajoy.
But the prime minister has made clear that when it comes to Catalonia, there is no quick fix.
"The Catalan crisis is not going to be solved in one, two or even six years," Sánchez told El País newspaper.
Sánchez has committed to removing the remains of Spanish dictator Franco from the Valley of the Fallen, a macabre monument to those killed during the Spanish Civil War (1936-1939) that many instead view as a monument to fascism.
The Socialist government wants to remove Franco and turn the Valley of the Fallen, a cavernous basilica outside Madrid under which lie nearly 34,000 civil war dead from both sides of the conflict, into a place of reconciliation.
The dictator's bones could be removed as soon as this month. Franco's family and far-right supporters want to block the move. The Popular Party has opposed attempts to exhume the remains of the generalissimo.
"I think that Spaniards have other priorities in their daily lives. We're seeing a government that is limiting itself to gestures and sensationalism," said María Dolores de Cospedal, one of the candidates to succeed Rajoy as head of the PP.
With the anniversary of the start of the Spanish Civil War on July 17, Sánchez could win a big publicity coup, and again hit international headlines, by exhuming Franco on that date.
Sánchez has quickly sought to ally himself with France's government, led by a fellow center-left, pro-EU moderate, and position Spain as an important European power.
"Sánchez has already made it clear that Spain's role in Europe is changing," sociologist Galindo told NPR. "From a discreet position, Sánchez is leading the country to be an important part of continental decisions in what is probably the most contentious issue of today: immigration."
Ahead of his first European summit, Sánchez made his first official visit abroad, meeting France's Macron at the Élysée Palace in Paris on June 23 to discuss immigration.
Macron provided support during the Aquarius crisis, offering migrants the chance to claim asylum in France if they wished.
Sánchez has also shown early signs of not being easily swayed by the United States. Spain, like other NATO members, received a letter from President Trump in June urging it to increase defense spending to at least 2 percent of its gross domestic product. But in a meeting with NATO Secretary-General Jens Stoltenberg in Madrid on July 3, Sánchez said Spain's contribution should not be measured solely on spending percentages but also on its "availability of military capacity" and "the willingness to use it," El País reported.
Spanish Foreign Minister Josep Borrell added that, although Spain budgeted to spend 0.92 percent of its GDP on defense this year, it has been an active participant in NATO missions.
Analysts say to expect more "symbolic" policymaking from Sánchez in the coming months, as he attempts to cement his power and drum up support among legislators and voters.
"He will put an emphasis on highly visible gestures and will try to avoid any major scandals," said political scientist Lapuente.
A survey conducted by Spanish broadcaster Cadena Ser following the no-confidence vote showed Spaniards have more confidence in the Sánchez administration than in the Rajoy government.
The survey, published after Sánchez's first week in office, also said 41.3 percent of Spaniards believe Sánchez's government is more capable of solving the Catalan crisis, compared with just 16.5 percent who thought the same of his predecessor.
The Socialist party's popularity has also risen. Two polls published in right-leaning newspapers ABC and La Razón in June said that the party would win considerably more seats if elections were held.
Spanish elections are held every four years, so the next vote must be held before July 26, 2020. But a prime minister has the right to call a snap election at any time, something many thought Sánchez may do.
But Sánchez has said he will not call elections until 2020, a canny decision, according to Lapuente.
"Time is his best ally," Lapuente said. "The longer he stays in office, the longer he looks like a viable PM and the higher his chances are of winning the next elections."