At the height of the popular uprising in Tunisia, the Obama administration confronted a difficult choice: embrace a little-understood democracy movement, or side with a staunch ally who stood for three decades as a bulwark against Islamic extremism and al-Qaeda.

Three months later, U.S. officials are looking back on Tunisia’s Jasmine Revolution with something akin to nostalgia. In the weeks since dictatorships were toppled in Tunis and Cairo, the changes sweeping the Middle East have brought only worsening violence and, for the White House, an array of bad options.

Secretary of State Hillary Rodham Clinton traveled to Tunisia and Egypt this week in a visit that was intended to show support for two countries where pro-democracy movements prevailed. But at each stop, Clinton was dogged by questions about looming crises in other countries where democratic aspirations have been met with brute force.

On Thursday, as she shuttled between meetings with interim government officials in Tunisia’s sun-drenched capital, Clinton conferred with European and Middle Eastern allies on how to stave off violence against anti-government forces in Libya, deal with a refugee crisis and respond to a deadly crackdown on protesters in Bahrain. In the case of Libya, the administration faced the prospect of either participating in military intervention in a third Muslim country or standing back and failing to prevent the possible annihilation of Libya’s fragile pro-democracy movement.

“There is no good choice here,” Clinton acknowledged during a town-hall meeting with Tunisian students and business leaders. “If you don’t try to take [Libyan leader Moammar Gaddafi] out — if you don’t support the opposition and he stays in power — there is no telling what he will do.”

The Obama administration’s cautious stance on U.S. intervention was sharply questioned during Clinton’s three-day visit to North Africa, including in Tunisia, where protesters greeted the U.S. diplomat’s motorcade, some waving signs that asked, “How much bloodshed?”

At the town-hall meeting in Tunisia, two questioners demanded to know why Washington was taking so long to act. “Do you want Gaddafi to remain in power?” one young man asked during the televised event.

Clinton repeated what has been the Obama administration’s core message for two weeks: “Gaddafi must go.” And she acknowledged the long odds faced by Libyan rebels who are being pounded by a “leader who recruits mercenaries . . . and is willing to bomb his own people.”

But she also expressed familiar cautions about how and when U.S. military forces might be deployed. No action would be taken without international approval and participation, she said.

“Neither the United States nor any other country will act unilaterally, but only if there is a U.N. Security Council resolution authorizing action,” Clinton said at a separate news conference at the Tunisian prime minister’s palace. She declined to speculate on whether a future military response would be limited to a no-fly zone or expanded to allow attacks on tanks and other weapons systems.

Later on Thursday, the Security Council voted to authorize “all necessary measures” to protect Libyan civilians.

Clinton said the Obama administration would avoid unilateral action that would lead to questions about American intentions and motives. “When we act, we want to act with international partners,” she said, adding that White House officials “very much want to have Arab participation in whatever action is authorized.”

By choosing to visit Tunis and Cairo, Clinton sought to highlight two successful, if tentative, experiments in democratic transformation, while also focusing attention on the formidable challenges faced by the two countries as they seek to implement political and economic reforms after decades of autocratic rule.

In a series of meetings with journalists, government officials and civil-society leaders, Clinton touted U.S. economic aid and business partnerships intended to foster private business development and job growth. Both countries have struggled with high unemployment, especially among youth, as well as a legacy of official corruption.

“We know there is a lot of work to be done but we are very confident about the potential for democracy and economic opportunity,” she said.

At the town-hall meeting, she praised the Tunisian uprising as a contagion that is inspiring people around the world. But she cautioned that building democracy requires sustained commitment.

“It is about building institutions and convincing people to work together even when it’s hard,” she said. “. . . The euphoria in the streets gives way to a grinding system that is needed to produce good results.”