WASHINGTON — For two years, President Obama has resisted being drawn deeper into the civil war in Syria. It was a miserable problem, he told aides, and not one he thought he could solve. At most, it could be managed. And besides, he wanted to be remembered for getting out of Middle East wars, not embarking on new ones.

So when Mr. Obama agreed this week for the first time to send small arms and ammunition to Syrian rebel forces, he had to be almost dragged into the decision at a time when critics, some advisers and even Bill Clinton were pressing for more action. Coming so late into the conflict, Mr. Obama expressed no confidence it would change the outcome, but privately expressed hope it might buy time to bring about a negotiated settlement.

His ambivalence about the decision seemed evident even in the way it was announced. Mr. Obama left it to a deputy national security adviser, Benjamin J. Rhodes, to declare Thursday evening that the president’s “red line” on chemical weapons had been crossed and that support to the opposition would be increased. At the time, Mr. Obama was addressing a gay pride event in the East Room. On Friday, as Mr. Rhodes was again dispatched to defend the move at a briefing, the president was hosting a Father’s Day luncheon in the State Dining Room.

Few international problems have bedeviled Mr. Obama as much as Syria and few have so challenged his desire to reduce the American footprint in the world in order to focus energies instead on what he calls “nation building here at home.” As much as he wants to avoid getting entangled in what he regards as another quagmire, he finds himself confronted by a conflict that is spilling over into the region and testing American resolve.