In a reported published by the Interfax news agency, General Yuri Baluyevsky was quoted as saying that Russia was considering the possibility of taking military and other steps along its borders if the two countries became part of the organization.
"Russia will take unambiguous action toward ensuring its interests along its borders," he said. "These will not only be military steps, but also steps of a different character."
Moscow lobbied hard to head off Georgia and Ukraine's ambition for membership at last month's NATO summit in Bucharest, but alliance leaders intend to review their bid in December.
NATO turned down Georgia and Ukraine's applications for Membership Action Plans -- a stepping stone to membership -- but, under pressure from Washington, one of the strongest advocates of enlargement in the alliance, the alliance did say both would eventually become NATO members.
Russian Foreign Minister Sergei Lavrov said earlier this week that Moscow will do everything it can to prevent the two countries, run by pro-Western governments, from becoming NATO members.
Russia will do everything to prevent accession
"We will do all we can to prevent Ukraine's and Georgia's accession into NATO and to avoid an inevitable serious exacerbation of our relations with both the alliance and our neighbors," Lavrov told reporters.
Russia opposes the plan to grant membership on the grounds that such a move would pose a direct threat to its security and endanger the fragile balance of forces in Europe.
It also sees NATO's willingness to enlarge eastward as the continuation of the Western Cold War containment policy and the spread of a foreign military bloc along its border.
President Vladimir Putin said in February that Russia would consider directing its missiles at Ukraine if the neighboring state ever hosted NATO military installations.
Russia's fears have also been stoked by plans by the United States to install interceptor missiles and radar stations in Poland and the Czech Republic as part of a wider missile defense shield designed to protect the US from attack by rogue states such as Iran and North Korea.
Lavrov warned earlier this week that states hosting parts of a US missile defense shield also risked facing a military response if Moscow's security concerns were not met.
Demands for presence at missile shield installations
The Russian foreign minister demanded that the Russian military be allowed a "permanent presence" at the planned US missile interceptor base in Poland and the radar site in the Czech Republic, threatening that Russia would otherwise consider "measures of military-technical character."
The threat put paid to the United States and its partners hopes of a shift in Russia's negative attitude after a big US push for compromise at last week's NATO summit and in one-on-one talks between President George W. Bush and Putin.
Russia is also said to have been angered by Bush's pressuring of European members of NATO to openly support Ukraine and Georgia's NATO bid despite being told by German Chancellor Angela Merkel that the topic was "off the table" for the time being at the meeting in Bucharest.
Germany, France fear destabilization
While Bush was forced into agreeing on a delay by Merkel and French President Nicolas Sarkozy, who fear a rash move to install the two former Soviet states as NATO members could destabilize an already volatile region on Russia's southern flank, his insistence was not lost on Russian observers.
However, General Baluyevsky said it was too early to talk about Ukrainian or Georgian entry into NATO.
"The population of Ukraine is unambiguously against entry to NATO despite the so-called referendum in Georgia where seventy percent of the population supported the idea,” he said. “It is not over yet."