When Labour leader Jeremy Corbyn outperformed expectations in the UK’s recent general election, he upended the country’s political culture and energised a generation of young supporters.

But his achievement also sparked a wave of optimism among activists in Mexico, who are starting to hope that they might soon have a friend in 10 Downing Street.

Britain’s Conservative government has forged close ties with Mexico’s Nieto administration, which has been tainted by corruption scandals, worsening violence and accusations of spying on journalists and activists.

And while Theresa May has sought to appease Donald Trump, who has threatened and offended Mexico at every opportunity, Corbyn has become an unlikely source of inspiration for Mexican activists.

Corbyn, whose wife, Laura Álvarez, is Mexican, often speaks at solidarity events organised by London’s Mexican community. He has, in parliament, condemned Mexico’s media censorship and human rights abuses, and led demonstrations against Nieto’s state visit in 2015 while the British government was signing controversial oil deals.

Corbyn also wrote to Mexico’s ambassador to express “deep concern” over the disappearance of 43 students abducted by police officers in southern Mexico in 2014.

Omar García, who escaped on the night his classmates from the Ayotzinapa college were attacked, met Corbyn and his wife while touring Europe last year to raise awareness about the situation in Mexico.

“It’s great that there are people like them looking out for us,” García said. “International pressure is fundamental. That’s the only way our government pays attention, when someone more powerful condemns the bad things they’re doing.”

Corbyn has close personal ties to Latin America. His second wife, Claudia Bracchitta, was exiled from Chile when Augusto Pinochet seized power in a military coup. Corbyn led attempts to extradite the former dictator to face trial in Spain after he was arrested in London in 1998.

Corbyn met Álvarez, his third wife, after her niece was abducted in West Sussex in 1999. He reportedly helped the family to contact the police and spoke at fundraisers before the missing girl was located in 2003.

Álvarez worked as a human rights lawyer before moving to England and now runs a small fair-trade coffee business. She kept a low profile throughout the last election but if Corbyn becomes the next prime minister, she would be the first foreign spouse to inhabit 10 Downing.

Étienne von Bertrab, an academic at University College London, met Corbyn and Álvarez through the local activist group Justice Mexico Now.

“Corbyn admires and loves Mexico. I think he probably has a deeper knowledge of Mexican history and recent developments than many Mexicans do,” Von Bertrab said. “Where else have we found someone with that level of knowledge and concern to publicly challenge the Mexican government? I haven’t found that anywhere in the world.”

Von Bertrab also noted that Corbyn has often criticised Trump’s planned border wall, adding: “It would be great to have a leader of a country like the UK stand up to Trump.”

Corbyn also has links to Mexico’s political opposition. Last Christmas he met Andrés Manuel López Obrador, the Mexican left’s perennial presidential candidate, who narrowly lost two presidential elections and will stand again next year. In a low-key encounter, the silver-haired pair posed for photos beside ancient Toltec ruins in López Obrador’s home state of Tabasco.

“We had a friendly encounter,” López Obrador said afterward. “We talked extensively about the beautiful dream of making a world government based on justice and fraternity a reality.”

Although wildly popular on the left, both men have faced skepticism from centrists and accusations from the right that they would introduce Venezuelan-style socialism to their respective countries.

“López Obrador is a very divisive figure who you either love or hate,” said Lila Caballero, a Mexican development worker who lives in London. “He’s a symbol of the left that just hasn’t managed to make it into power in Mexico.”

Caballero sees some similarities between them, but after meeting Corbyn several times and canvassing for Labour in the last election, she believes he is a more effective campaigner.

“Corbyn really managed to appear grounded and speak to people in a way that they understood him and felt compelled to vote for him,” she added. “I think López Obrador and all Mexican politicians need to learn from that, because it’s not populism, it’s actually listening to people. We need politicians like Corbyn in Mexico.”