CHISINAU, Moldova — Diplomats from Russia, the United States and Europe have rarely agreed about international issues lately. But on Friday their united efforts helped resolve a constitutional crisis in an unlikely location: the Republic of Moldova, a small landlocked state between Romania and Ukraine in southeast Europe.

For nearly a week, a new coalition government had been prevented from taking office in Chisinau, the Moldovan capital, after the outgoing administration refused to leave.

The impasse ended on Friday afternoon, when the former prime minister, Pavel Filip, grudgingly resigned in response to the prospect of mass protests over the weekend. He also faced increasing international pressure from Moscow and several European capitals, and a private visit from the American ambassador, Dereck J. Hogan, according to two people involved in the negotiations.

The new government was formed from a coalition of two groups, the pro-Russian Socialist party and the pro-Western Now Platform party. Maia Sandu, a former World Bank official who leads the Now Platform party, was named prime minister.