Russia has approved a draft agreement with Egypt for Russian warplanes to use Egyptian military bases, in a move allowing Moscow to increase its military presence in the Middle East.

The draft deal was published on November 30 after being signed by Russian Prime Minister Dmitry Medvedev on November 28. It requires the Russian Defense Ministry to negotiate details of the agreement with Egyptian officials.

As outlined in the draft plan, the deal would allow each country's military to use the other's air bases for a period of five years, which could be extended if agreed.

Russia raised its profile in the Middle East in 2015 by launching a campaign providing air support for Syrian President Bashar al-Assad's troops in their civil war against Sunni rebels. Russia has an air base and a naval supply facility in Syria, which it plans to expand.

Egypt was Moscow's closest Arab ally in the 1950s and 1960s, when nationalist leader Gamal Abdel-Nasser turned away from the United States and secured Soviet backing. Nasser's successor, Anwar Sadat, broke ties with Moscow and evicted Soviet military advisers.

Sadat's landmark peace deals with Israel in the 1970s increased Egypt's standing with the West and made it an anchor of stability in the volatile region. Under the deal, the United States agreed to give billions of dollars in military aid to Egypt each year.

But ties with the United States have weakened in recent years and Egypt's current president, Abdel-Fattah el-Sisi, has developed friendly ties with Russian President Vladimir Putin.

Sisi has expanded trade with Russia and shown a renewed interest in Russian arms purchases, with Cairo recently signing deals to buy Russian fighter jets, helicopters, and other weapons.

Russian Defense Minister Sergei Shoigu visited Cairo on November 29 for talks and praised what he called the "positive dynamics in the military-technical sphere."

Offering condolences for the massacre at a mosque in Egypt's Sinai Peninsula last week that killed over 300 people, Shoigu emphasized the need to strengthen cooperation in fighting terrorism.

"We believe that it's necessary to fight this evil together using all accessible means," he said.

The local affiliate of the extremist group Islamic State has not formally claimed responsibility for the mosque attack, but the gunmen that mowed down the worshippers carried the black banner of the militant group.

The IS affiliate has previously claimed responsibility for the October 2015 downing over the Sinai of a Russian passenger jet that killed all 224 people on board, most of them Russian tourists.

IS said it blew up the plane with a bomb smuggled on board, a claim confirmed by Russian investigators. The bombing prompted Russia to cut commercial flights with Egypt, dealing a heavy blow to the country's tourism industry.

Moscow and Cairo have held talks on boosting airport security and resuming commercial flights, but no agreement has been reached.