BERLIN — Germany said on Wednesday that it would withdraw its forces from a military base in southern Turkey after the government of President Recep Tayyip Erdogan refused to guarantee visits to forces there by German lawmakers, deepening a rift between the NATO allies.

The decision by the German cabinet to transfer to Jordan the troops, surveillance planes and refueling jets at Incirlik Air Base in Turkey came after Foreign Minister Sigmar Gabriel failed to persuade others in the Turkish government to ensure the visits by German representatives.

The German defense minister, Ursula von der Leyen, said that German surveillance planes were an important part of operations against the Islamic State. Not having them available for two or three months during the move, however, would have more of a symbolic than practical effect — putting two NATO allies publicly at odds rather than working together.

The dispute over access to the troops has brewed for months as relations have deteriorated between Turkey and Germany, home to the largest Turkish diaspora in the world, with three million people of Turkish descent.