Behind the scenes, the officials, who spoke on the condition that they not be named because they were discussing internal deliberations, said Mrs. Clinton had been advocating the stronger U.S. response, but the president resisted. When he finally took her advice, the aides said, he did so without informing her first.

This was the first known example of awkwardness between the two former rivals for the Democratic nomination for president since they made up following Mr. Obama’s election. The disagreement also gave some insight into the Obama administration’s foreign policy decision-making process five months into its term.

The officials said they were familiar with the language Mr. Obama used in his news conference because it was sent to the State Department a day earlier, but that Mrs. Clinton did not know until he uttered the words that he would choose that moment to make them public.

“It was a happy surprise,” one administration official said. “It was echoing the line the secretary had been pushing for a couple of days.”…

Mrs. Clinton … thought it was time to get tougher after the June 20 killing of a young woman, Neda Agha-Soltan, on a Tehran street, officials said. A video of the killing was widely viewed on the Internet.