United by a deep hostility towards Islamists, Egyptian President Abdel Fattah al-Sisi and Russia's Vladimir Putin said on Tuesday they were both committed to fighting the threat of terrorism.
The general and the former KGB officer found common ground on security at talks in Cairo that signalled a rapprochement between their two countries, at a time when relations between Egypt and the United States have cooled.
Sisi, who is fighting a raging Islamist insurgency in the Sinai region, said Putin had agreed with him that "the challenge of terrorism that faces Egypt, and which Russia also faces, does not stop at any borders".
Putin, making his first state visit to Egypt in a decade, said they agreed on "reinforcing our efforts in combating terrorism". He presented his host with a Russian-made Kalashnikov rifle, and Sisi handed him a plaque with a picture of Putin.
The Kremlin chief was the first leader of a major power to visit Egypt since former army chief Sisi became president in 2014, having toppled Islamist President Mohamed Mursi the previous year after mass protests against his rule.
Sisi has repeatedly called for concerted counter-terrorism efforts in the Middle East and the West. Egypt has fought Islamist militancy for decades, mostly through security crackdowns that have weakened, but failed to eliminate, radical groups.
Highlighting the challenge, security sources on Tuesday said 15 suspected Islamist militants had been killed in air raids in the Sinai Peninsula. The interior ministry said suspected Islamist militants bombed three police stations in Egypt's second city Alexandria on Tuesday.
Putin has also resorted to force against Islamists, sending troops to quell a separatist rebellion in Chechnya, but still confronts insurgents in parts of the predominantly Muslim North Caucasus region.
STRATEGIC FRIEND
Egypt and the Soviet Union were close allies until the 1970s when Cairo moved closer to the United States, which brokered its 1979 peace deal with Israel.
That relationship cooled after the army's overthrow of Mursi, which prompted Washington to suspend some military aid. Sisi has since opened up to Moscow, describing Russia on Tuesday as a "strategic friend".
Putin, facing Western isolation and sanctions over his support for pro-Russian separatists in neighbouring Ukraine, received a grand welcome in Cairo, where his portrait and the Russian tricolour were predominantly displayed.
The Russian leader was given a 21-gun salute as he was driven through the driveway of the presidential palace, flanked by soldiers on horseback. He was greeted by Sisi and cheering children waving the Russian flag, and had to endure an off-key rendition of Russia's national anthem.
Putin said he expected a new round of talks on the Syrian conflict, following on from a meeting of some opposition figures and the Damascus government in Moscow last month.
"We look forward … to the next round of such talks, which ultimately I hope will lead to a peaceful settlement of the situation in Syria," Putin said.
The Moscow talks, which ended on Jan. 29, were not seen as yielding a breakthrough as they were shunned by the key political opposition in Syria and did not involve the main insurgent groups fighting on the ground.
Moscow has been a long-standing ally of Syrian President Bashar al-Assad, whose government has called many of its opponents terrorists in the civil war that has killed more than 200,000 people since 2011.