Live updates: follow the latest news on Russia-Ukraine
"We have alerted both countries of the region and elsewhere not to pass warships through the Black Sea," Foreign Minister Mevlut Cavusoglu said. "We are applying the Montreux Convention."
The 1936 Montreux Convention governs the free movement of commercial ships in peacetime through the Bosphorus and the Dardanelles straits.
But it grants Turkey the right to block the passage of warships in both straits, which connect the Aegean, Marmara and Black Sea, in wartime if threatened.
Turkish President Recep Tayyip Erdogan had just clarified Turkey's position as a Nato member "not to abandon either Russia or Ukraine" and not to "cede Turkey's national interests".
"We have decided to use the Montreux Convention to prevent the escalation of the crisis," Mr Erdogan said after a Cabinet meeting.
Ukraine last week officially asked Turkey to close the Dardanelles Strait, and thus access to the Black Sea, to Russian ships.
Nato member Turkey, which has strong ties with Russia and Ukraine, did not immediately respond to the request.
"Russia asked us if we would apply the Montreux Convention if necessary," Mr Cavusoglu said. "We told them we would apply it word for word."
He said Turkish experts had been studying the situation to assess "whether there is a state of war from a legal point of view".
Turkey is navigating its own narrow diplomatic passage between its ally Kiev, to which it has sold combat drones used against Russian tanks, and Moscow, on which it depends for its gas and grain supplies.
But Turkey on Sunday officially recognised Russia's attacks on Ukraine as a "state of war".
Mr Erdogan on Monday said he considered "Russia's attack on Ukrainian territory as unacceptable" and praised the struggle of the Ukrainian government and people.