With threats growing in Asia, the leaders of the United States, Japan and South Korea will meet at Camp David on Friday, taking a major step toward a three-way military and economic partnership that would have been nearly inconceivable before Russia’s invasion of Ukraine.

As the United States has tried to counter challenges from both China and North Korea, one key obstacle has been the tense and sometimes downright hostile relationship between Japan and South Korea, its two most important friends in the region.

Now, Tokyo and Seoul are trying to quickly move past seemingly irresolvable disputes over the bitter history between them, as Russian aggression against Ukraine highlights their own vulnerabilities in a region dominated by China.

President Biden hopes to cement the nascent improvement in relations when he hosts Prime Minister Fumio Kishida of Japan and President Yoon Suk Yeol of South Korea at the Maryland presidential retreat. It will be the first time that leaders of the three nations have ever met outside the context of a larger summit, as well as the first time that Mr. Biden has invited world leaders to Camp David.

Secretary of State Antony J. Blinken said this week that the meeting would give the three heads of state a chance to talk about concrete steps toward maintaining regional peace and stability.

That’s diplomatic speak for “the need for a response to the challenges coming from China,” said Tetsuo Kotani, a senior fellow at the Japan Institute of International Affairs.

But Russia will lurk in the meeting’s background, Mr. Kotani said. Moscow’s attempt to seize Ukraine by force has sharpened the focus on Beijing’s threats to do the same to Taiwan. It has also raised concerns about the growing alignment among China, Russia and North Korea, all nuclear powers.

The emergence of what the North Korean leader, Kim Jong-un, has called a “neo-Cold War” around the Korean Peninsula was on display last month. Russia’s defense minister, Sergei Shoigu, and Li Hongzhong, a member of the Political Bureau of the Chinese Communist Party, stood with Mr. Kim in Pyongyang during a military parade featuring the nuclear-capable missiles that North Korea has developed in defiance of the United States and the U.N. Security Council.

Trilateral missile drills last month among the United States, Japan and South Korea in the sea between the two Asian nations were followed by military exercises between China and Russia in nearby waters.

The gathering sense of threat has destroyed complacency in Seoul and Tokyo that had been a hurdle to forming a tighter three-way partnership with the United States, which has acknowledged for years that it cannot counter China alone. And it has pushed both Asian capitals to play a more active role in Europe, where they have provided aid to Ukraine and pursued closer ties with NATO.

“The situation in our part of the world is getting much, much worse than many had expected,” said Kunihiko Miyake, the research director at the Canon Institute of Global Studies.

The meeting at Camp David will be an opportunity to consolidate and institutionalize the progress that Washington, Seoul and Tokyo have made in the past year in tightening their ranks, officials from the nations said.

The United States has spent decades fruitlessly trying to get Japan and South Korea to work together on security issues. And there is an awareness in all three countries that the progress that has been made is fragile.

Mr. Yoon’s efforts to improve ties with Japan have galvanized popular anger ahead of a legislative election in April. Mr. Kishida, too, has a weak political position at home, where mismanagement of domestic issues has hurt his popularity, and where more conservative politicians are wary of anti-Japanese sentiment in Seoul. Both Asian nations worry that U.S. pledges of cooperation could be undone if Donald J. Trump is elected president next year.

With that in mind, one of the meeting’s key goals is to embed mechanisms of cooperation “in the DNA” of the three governments and to “create a new normal” that will be difficult to reverse, Rahm Emanuel, the U.S. ambassador to Japan, said in a recent interview.

Kim Tae-hyo, a deputy national security adviser to Mr. Yoon, said that the South Korean administration expected the summit to “establish a key structure of trilateral cooperation and institutionalize it.”

The most visible manifestation is likely to be a pledge to hold an annual meeting among the countries’ three leaders. More practically, officials are expected to announce expanded cooperation not only in joint military drills and military information-sharing, but also in artificial intelligence, supply chains and cyber and economic security.

The three heads of state will also discuss concrete steps for deterring North Korea’s nuclear and missile threats, Mr. Kim said.

Since taking office last year, Mr. Yoon has emphasized improving ties with Japan and aligning South Korea more closely with Washington and Tokyo in confronting China, Russia and North Korea.

Under Mr. Yoon, South Korea has restored and expanded joint military drills with the United States and joined exercises with the United States and Japan to track and intercept missiles from North Korea.

In a speech on Tuesday marking the anniversary of Korea’s liberation from Japan at the end of World War II, Mr. Yoon avoided discussing his country’s historical grievances with Tokyo, emphasizing instead the benefits of partnership.

The Camp David summit, he said, “will set a new milestone in trilateral cooperation contributing to peace and prosperity on the Korean Peninsula and in the Indo-Pacific region.”

Perhaps most important, Mr. Yoon has taken steps to resolve a festering controversy over Japan’s wartime use of Korean forced labor. That opened the door for an exchange of visits between Mr. Yoon and Mr. Kishida and the rollback of Japanese sanctions on the Korean semiconductor industry.

As a gesture of good faith, Mr. Kishida has also held off on releasing treated radioactive water from the destroyed Fukushima nuclear power plant until after the summit. The subject is a lightning rod in South Korea.

Not all South Koreans have been happy with Mr. Yoon’s pivot. His domestic critics rail at what they describe as Japan’s failure to properly atone for its brutal colonial rule. They fear that Mr. Yoon’s efforts to deepen military cooperation among the United States, Japan and South Korea will only raise tensions — and the chances of war — on the Korean Peninsula.

As for China, it may seek its own meeting with Tokyo and Seoul in response to the Camp David summit, said Wu Xinbo, dean of international studies at Fudan University in Shanghai.

But, he added, if there are “substantive actions that are unfavorable to China,” Beijing may take a “relatively tough response.”

Wang Yi, China’s top diplomat, warned Japan and South Korea last month against aligning themselves too closely with the United States. “No matter how yellow you dye your hair, or how sharp you make your nose, you’ll never turn into a European or American, you’ll never turn into a Westerner,” Mr. Wang said.

Wang Wenbin, a spokesman for China’s Ministry of Foreign Affairs, cautioned the three countries against forming “cliques,” adding that Beijing “opposes the practice of intensifying confrontation and harming the strategic security of other countries.”

The possibility of economic retaliation by Beijing is a serious concern for both South Korea and Japan, who count China as their largest trading partner.

Both nations “are uneasy with the idea of a new Cold War, an economic war with China,” said Daniel Sneider, a lecturer in international policy at Stanford University.

“But they still have to navigate trying to find some balance between engagement and competition and confrontation,” he said.

Ben Dooley reported from Tokyo, and Choe Sang-Hun from Seoul. Claire Fu contributed reporting from Seoul.