Russia will respond harshly to any US measures designed to hurt it, the foreign minister said, a day after Washington told Moscow to close its San Francisco consulate and two other facilities.

Moscow "will have a tough response to the things that come totally out of the blue to hurt us and are driven solely by the desire to spoil our relations with the United States", Foreign Minister Sergey Lavrov said on Friday.

The warning came as Russia said it was weighing a response to the US move that will force it to shutter its San Francisco consulate, as well as its trade missions in Washington, DC and New York City by Saturday.

The spat between the two nuclear-armed powers is another blow to US President Donald Trump's pledge to try to improve relations with Russia's Vladimir Putin.

OPINION: Is Russia a real threat to the West?

The US ordered the closures in a retaliatory move after the Kremlin demanded Washington slash staff numbers at its Russian diplomatic missions to 455 personnel with a deadline that ran out on Friday.

Russia's demand came after Congress overwhelmingly approved new sanctions against Russia in July.

"The United States has fully implemented the decision by the government of the Russian Federation to reduce the size of our mission in Russia," State Department spokeswoman Heather Nauert confirmed in a statement.

Washington said it hoped the two sides "can avoid further retaliatory actions" and improve ties but warned it was "prepared to take further action as necessary and as warranted."

'Takes two to tango'

Russia's Lavrov avoided blaming the Trump administration outright for the latest tensions and laid the guilt squarely at the door of Trump's predecessor Barack Obama.

"We are open even now for constructive cooperation where it corresponds to Russian interests," Lavrov also said on Friday.

"But it takes two to tango and so far our partner is, again and again, doing an individual break dance."

The dispute began when former US President Barack Obama expelled 35 Russian diplomats in December over allegations of Russian interference in last year's presidential election.

Lavrov is to meet his US counterpart Rex Tillerson this month in New York.

READ MORE: Tillerson to Lavrov - Russian meddling led to mistrust

Meanwhile on Friday, Russia's foreign ministry spokeswoman Maria Zakharova said the FBI planned to search the San Francisco consulate on Saturday and accused US authorities of threatening the "security" of Russian citizens and violating diplomats' immunity.

"We are talking about invasion into a consulate and the accommodations of diplomatic staff," Zakharova said in a statement. "The demands of the US authorities create a direct threat to the security of Russian citizens."

"We express a resolute protest over Washington's actions that ignore international law," Zakharova said, adding that: "We reserve the right to take retaliatory measures."

The State Department has not commented specifically on whether officials plan to search the premises.

But it did say that as of Saturday, access to the consulate will only be granted with State Department permission.

Source: News agencies