Premier-designate Bulent Ecevit's moderately leftist minority government failed to win parliamentary endorsement today, shattering hopes of an early solution of the Cyprus conflict and settlement of differences between Turkey and the United States created by the Turkish invasion of Cyprus.

Ecevit's defeat, by this votes to 217 in the National Assembly, made almost inevitable another period of divisive coalition rule and prolongation of Turkey's difficulties at home and abroad.

President Fahri Koraturk to whom Ecevit gave his resignation following his defeat, could ask Ecevit to try to form a coalition, or Koruturk could replace him as premier designate with former Premier Suleiman Demirel, whose conservative Justice Party is the second largest in Parliament.

Koruturk is experted to announce his decision early this week.

Either Ecevit, head of the Republican People's Party, or Demirel would need the support of the pro-Moslem National Salvation Party, the third largest in Parliament, to form a coalition.

The Salvation Party is strongly opposed to returning any territory occupied by the Turks on Cyprus to the Christian Greek-Cypriots.

Settlement of the Cyprus conflict is a prerequisite to solving problems plaguing relations between Turkey and the United States, and to strengthening NATO's weakened southeast flank.

Greece withdrew from the NATO military command following the Turkish invasion of Cyprus and Congress blocked U.S. military aid to the Turks. Ankara retaliated by closing American bases in Turkey.

Greece's return to NATO, resumption of U.S. military aid to Turkey, and reopening of the American bases hinges on settlement of the Cyprus conflict.

Ecevit, 52 told supporters following his defeat that any government formula that excluded the Republicans, the largest party in Parliament, would be "unrealistic."

Observers said this indicated his willingness to head a coalition government - a proposal he had earlier rejected. It also indicated his desire for a second chance.

Ecevit was the first Turkish politician to try to form a government following inconclusive general elections June 5. He had hoped that support from independents, centrists and rightist dissidents would give his proposed minority government the necessary National Assembly majority.

Despite three weeks of intensive lobbying. Ecevit failed to make a single rightist break ranks. Only two independents and one centrist voted for his government.

Large crowds gathered outside the National Assembly building in Ankara during the confidence vote and police dispersed about 200 leftists demonstrators.

Ecevit will continue as premier in a caretaker capacity until a new government is announced.

Prolongation of the government, vacuum could worsen Turkey's already serious economic situation.

Turkey's foreign reserves have plunged to about $500 million. American banks are refusing credit to U.S. companies operating in Turkey, several of which have indicated they may soon have to closed down.

This would add to chronic unemployment problems and disrupt plans for rapid industrialization.

The World Bank and private foreign banking consortiums have said they are willing to extend Turkey more credit only if it devalues its currency. Until it has a government, however, Turkey cannot take that step.