Ahead of President Trump’s meeting with and Russian President Vladimir Putin in Helsinki Monday, he tweeted that the United States’ relationship with Russia was at an all time low. He blamed past U.S. policy.

The president has been reticent to criticize Putin, and he has said he admires his leadership style and strongman image. When the two met on Monday morning for their first formal one-on-one summit, they shook hands. Trump then congratulated Russia on successfully hosting the World Cup, which ended on Sunday.

“I think we will end up having an extraordinary relationship,” Trump said.

The lead-up to Trump and Putin’s meeting varied greatly compared to how Trump approached his relationships with two of the most powerful women in the world last week: British Prime Minister Theresa May and German Chancellor Angela Merkel.

“Everyone noted that Trump has been particularly harsh to the two female world leaders,” said one European official.

Added a second European official: “He has been more and more anti-E.U. He doesn’t care about allies. But he particularly has a problem with Merkel and May — who are women.”

The officials, like other former and current European and U.S. officials interviewed for this report, spoke on the condition of anonymity to describe candidly the president’s interactions with Merkel and May.

Trump’s most recent attack came Thursday night when Trump told the Sun, a British newspaper, that May had ignored his advice on Britain’s exit from the European Union, placing a bilateral trade deal with the United States in jeopardy. The issue is especially fraught as May scrambles to maintain the coalition.

“I actually told Theresa May how to do it, but she didn’t agree,” Trump said of his advice to May on exiting the E.U. “She didn’t listen to me.” He then suggested that one of her main conservative rivals would make a “great prime minister.”

Standing next to May at a Friday news conference, Trump shifted his tone — describing May as an “incredible woman” doing a “fantastic job” and asserting that the British tabloid did not quote his more positive remarks about the prime minister.

May was careful not to praise or criticize Trump, who is highly unpopular in the U.K. (Protests featuring a giant “Trump baby” blimp ensued during his visit.) But Trump filled the void. “I am doing a great job!” he said.

Catering to Trump’s ego

Trump’s tense relationship with Merkel and May is rooted in real policy disagreements on issues such as trade, defense spending and immigration, U.S. and European officials said.

But analysts noted that the two female leaders had been less willing than others, such as French President Emmanuel Macron or Japanese Prime Minister Shinzo Abe, to cater to Trump’s ego.

“I think it is much more about their approach to him,” said Danielle Pletka, senior vice president for foreign and defense policy studies at the conservative American Enterprise Institute. “Both of them have been confrontational toward him, and that’s not a good way to manage Donald Trump, in my opinion.”

Then there was a third explanation touted by several European diplomats over the past week: their gender. Trump has been particularly quick to praise self-styled strongmen, including North Korean leader Kim Jong Un, Philippine President Rodrigo Duterte and Russian President Vladi­mir Putin, whom he is scheduled to meet Monday in Helsinki.

White House press secretary Sarah Huckabee Sanders said that Trump has a good relationship with both women. She noted that in Brussels, Trump gave Merkel “a huge hug, kissed both her cheeks and announced to everyone that he loves her.”

His assessment of Germany on Friday was less enthusiastic: “It’s a very sad situation,” he said regarding the immigration policy that Merkel has championed.

Policy differences with Germany

Before he arrived in London, Trump slammed Germany as “captive to Russia,” citing its reliance on Russian natural gas. His remarks drew a clipped rejoinder from the chancellor. “I myself experienced a part of Germany that was controlled by the Soviet Union,” she said. “I am very happy today that we are united in freedom as the Federal Republic of Germany.”

“Trump is obsessed with trade and blames Merkel — incorrectly in my view — for the U.S.-E.U. trade deficit,” said Kristen Silverberg, a U.S. ambassador to the E.U. during the George W. Bush administration.

Trump frequently complains to Merkel and to his aides about E.U. trade practices that favor Germany’s automobile industry at the expense of the United States.

His frustration with Merkel over the Russian natural gas issue also has been building for months. “Putin has got her by the balls with that gas pipe,” Trump complained earlier this year, according to two senior White House officials who heard the remark. At the time Trump was worried that Merkel might not follow through on a plan to expel Russian diplomats and suspected spies for the poisoning of a Russian ex-spy and his daughter on British soil.

Conversations with May

Trump’s conversations with May are rarely convivial or easy. A former special adviser to May, who was present for calls and meetings with Trump, said the American president often began their discussions by encouraging Britain’s speedy withdrawal from the E.U.

“Have you left yet?” the president asked, according to the adviser. “When are you going to leave?”

Brexit is one of the most fraught political issues May faces, and her insistence on a gradual or “soft” withdrawal recently led to the resignations of two of her most important cabinet members — Boris Johnson, who was her foreign minister, and David Davis, who was her Brexit secretary.

How Merkel and May work with Trump

Merkel, a German official said, has tried to persuade Trump with detailed information, particularly on trade. Gaining little traction with the president, German officials have instead relied on conversations with others in Trump’s Cabinet.

Merkel and May have sought to achieve peace with Trump. May delivered a rare rebuke of Trump in November for retweeting an inflammatory, anti-immigrant video from a far-right U.K. political group. Since then she has told advisers that she will find a way to work with him — no matter what.

“She would say, ‘He does things in an interesting way and you just have to get on with it,’ ” the ex-May adviser said.

James McAuley in Paris contributed to this report.

This 3-month-old just made United Nations history

New Zealand Prime Minister Jacinda Ardern brought her daughter, Neve, to the U.N. General Assembly

In China, grooms can pay for brides. Some villages want to limit the rising ‘bride price.’

Men outnumber women by the millions in China

This rising African photographer pushes viewers to rethink black bodies in her work

In her portraits, Yagazie Emezi’s seeks to promote new narratives