President Biden has consistently resisted pressure during 27 months of war to let Ukraine into NATO, convinced that it could quickly result in American troops being sent into direct combat with the Russians.

So on Thursday, he rolled out alternative steps designed to demonstrate to President Vladimir V. Putin of Russia that the United States and its allies had no intention of packing up and leaving.

He signed a 10-year security pact with President Volodymyr Zelensky of Ukraine that Mr. Biden portrayed as guaranteeing a supply of weapons, intelligence support, advice and technology needed to win the war and deter a new one.

He also said the United States would take the lead in providing Ukraine with a $50 billion loan to rebuild its devastated ports and power plants and to buy weapons. The money is to be repaid from interest generated from $300 billion in assets that Mr. Putin, inexplicably, left in Western financial institutions before his February 2022 invasion.

“Our goal is to strengthen Ukraine’s credible defense and deterrence capabilities for the long term,” Mr. Biden said moments after he and Mr. Zelensky signed the accord on the southwest coast of Italy, where the Group of 7 industrialized nations opened their annual leaders conference.