WASHINGTON — President Obama and Ukraine’s interim prime minister opened the door on Wednesday to a political solution that could lead to more autonomy for Crimea if Russian troops withdraw, as the United States embarked on a last-ditch diplomatic effort to defuse a crisis that reignited tensions between East and West.

The tentative feeler came as Mr. Obama dispatched Secretary of State John Kerry to London to meet with his Russian counterpart on Friday, two days before a Russian-supported referendum in Crimea on whether to secede from Ukraine. Mr. Obama said the world would “completely reject” what he called a “slapdash election,” but added he still hoped for a peaceful settlement.

In a show of solidarity for the besieged Ukraine, Mr. Obama hosted a White House visit by Arseniy P. Yatsenyuk, the country’s pro-Western acting prime minister, and vowed to “stand with Ukraine.” But he also hinted at a formulation that could be the basis for the coming talks between Mr. Kerry and Sergey V. Lavrov, the Russian foreign minister, recognizing Moscow’s interest in helping the Russian-speaking population in Crimea while affirming that it is part of Ukraine.

Mr. Obama said Mr. Yatsenyuk told him that a new Ukrainian government formed after elections scheduled for May 25 could find ways to address Crimea’s concerns. “There is a constitutional process in place and a set of elections that they can move forward on that, in fact, could lead to different arrangements over time with the Crimean region,” Mr. Obama said. “But that is not something that can be done with the barrel of a gun pointed at you.”