Egypt's Army Chief and Defense Minister General Abdel Fatah al-Sissi (2nd L) speaks with Russia's Defense Minister Sergei Shoigu (2nd R) after he arrived at the headquarters of the Ministry of Defense in Cairo on Nov. 14. (HANDOUT/REUTERS)

Egypt edged further away from its traditional place within the U.S. sphere of influence Thursday, hosting Russia’s foreign and defense ministers in the highest-level talks between the two countries in years.

The visit, which included discussions on strengthening military ties and diplomatic efforts on Syria, challenged the U.S. position as Egypt’s primary benefactor and was seen as a diplomatic swipe at Cairo’s increasingly estranged Western ally.

Russia, a stalwart supporter of embattled Syrian President Bashar al-Assad, has stepped up its role in the Middle East in recent months, taking action where Washington has been reluctant to engage and helping broker the deal to destroy Syria’s chemical weapons stockpiles.

Expanding ties with Egypt, the Arab world’s most populous country, would give Russia an even firmer foothold in countries that once relied mainly on their alliances with the United States.

“We are not replacing one party with another,” said Badr Abdel­atty, an Egyptian Foreign Ministry spokesman. “We want to strengthen the independence of our foreign policy. We want to diversify. And Russia is a very important global power.”

Sergei Shoigu’s visit to Cairo was the first by a Russian defense minister since the 1970s, when then-President Anwar Sadat ejected thousands of Soviet military advisers to curry favor with the West.

Egypt’s commanding general, Abdel Fatah al-Sissi, said Shoigu’s presence would help launch “a new era of constructive, fruitful cooperation on the military level.” In addition, the arrival of two Russian warships at Egyptian ports in the Mediterranean and the Red Sea in the past week marked the first joint naval maneuvers between the two countries in years.

U.S.-Egyptian relations have been tense since July, when Egypt’s military ousted Mohamed Morsi from the presidency in a popularly backed coup. A subsequent crackdown on Morsi’s supporters, including the violent dispersal of a mass sit-in in Cairo that killed hundreds, prompted the Obama administration to halt about a third of its $1.3 billion in annual military aid to Egypt. The United States also withheld delivery of F-16 fighter jets, M1A1 Abrams tank kits and Harpoon missiles.

A flurry of recent news media reports in Egypt and Russia suggested that the two countries were negotiating a multibillion-dollar weapons deal, which would demonstrate Egypt’s ability to procure advanced weapons systems without U.S. help. Although no deal was announced Thursday, ­Abdelatty, the Foreign Ministry spokesman, said: “Of course Egypt will be cooperating militarily with Russia.”

Michael Stephens, deputy director of the Qatar branch of the Royal United Services Institute, a defense industry think tank, called the talk of an arms deal “a bit of saber rattling.”

“But it doesn’t mean it won’t happen,” Stephens said. “If the Americans don’t respond positively to this, then we’ll see some problems. Then we’ll see some pushing forward for the deal.”

Russia recently clinched a $4 billion agreement to supply weapons to Iraq; the United States withdrew its troops from that country in late 2011.

One of the major obstacles to Egypt buying large-scale Russian weapons is cash flow. Persian Gulf countries such as Saudi Arabia, the United Arab Emirates and Kuwait provided Egypt with $12 billion in assistance after the coup to help keep the government afloat. But Egypt’s economy remains unstable, and the government needs to secure funding for dwindling foreign currency reserves, subsidies and expensive imports.

“The economy will not permit major weapons purchases,” said Safwat el-Zayyat, a former general. “Policies in the region depend on the man in power, and that can change very easily.”

Egypt’s courtship of Russia also may vex one of Cairo’s other chief backers, Saudi Arabia, which itself has signed arms deals with Russia but still views Moscow’s efforts in the region with suspicion. Saudi Arabia openly supports the Islamist rebels who are fighting the Syrian government.

At a news conference in Cairo, Russian Foreign Minister Sergei Lavrov emphasized Egypt’s role in solving the Syrian crisis, which he said was a main topic of discussion between him and Egyptian Foreign Minister Nabil Fahmy.

Egypt’s government has scaled back what it saw as Morsi’s reckless support for the Syrian uprising and has reopened the Syrian Embassy in Cairo. But if Russia moves to recruit open diplomatic support from Egypt for Assad, that could spur opposition from Saudi Arabia, Stephens said.

“If I were Egypt, I would be looking to Saudi more than Russia for my help,” Stephens said. “I don’t think it is wise for Egypt to start supporting Bashar al-Assad.”

Sharaf al-Hourani contributed to this report.