KIEV, Ukraine — Defense Secretary Jim Mattis vowed on Thursday to help Ukraine stand up to Russian violations of its sovereignty and signaled that the Trump administration was considering providing defensive weapons to the Ukrainian military.

President Barack Obama had resisted such a step, fearing it would be seen as a provocation by Russia. In the first visit to Ukraine by an American defense secretary in nearly a decade, Mr. Mattis seemed to be anticipating that argument.

“Defensive weapons are not provocative unless you are an aggressor, and clearly Ukraine is not an aggressor since it is their territory where the fighting is happening,” Mr. Mattis said at a joint news conference with Ukraine’s president, Petro O. Poroshenko.

State and Defense Department officials have recommended that the United States provide Javelin anti-tank missiles and other defensive weapons to Ukraine to strengthen its forces and raise the potential cost to the Kremlin of a Russian attack.