KUALA LUMPUR (Reuters) - From Turkey to the Philippines to Malaysia, it's been an overseas trip for United States President Barack Obama that often veered off-script.
By now, Mr Obama was supposed to have showcased the long-promised benefits of his strategic shift toward Asia as he nears his final year in office. Instead, he has spent much of his time focused on deadly Islamist attacks half a world away.
White House aides have fretted privately that the timing could not have been worse.
After struggling for years to prove that his so-called "Asia pivot" was real, they were hoping to gain more traction now that it has started bearing fruit in the form of a new signature trade deal and expanding security ties aimed at countering a rising China.
But, as one US official said, it did not happen exactly like planned.
As Mr Obama prepared to wrap up a four-summit trip in Kuala Lumpur on Sunday (Nov 22), he faced difficult challenges on his return to Washington - and few good options.
At home, the political clamour is growing for a tougher approach to Islamic State in Iraq and Syria (ISIS) in response to the deadly attacks in Paris, and the majority Republicans - as well of some of Mr Obama's fellow Democrats - show no sign of abandoning efforts to block US acceptance of more Syrian refugees.
Those same issues have dogged Mr Obama during eight days of travel overseas, leaving the president and his aides to make their case.
Unexpectedly from a president widely known as "no-drama Obama", there was a rare flash of anger when he spoke during his trip of "hysterical" politicians back home whom he accused of trying to bar Syrian child refugees from US soil to score political points.
Mr Obama has been to the G-20 meeting in Antalya, Turkey, the Asia-Pacific Economic Cooperation (Apec) gathering in the Philippines capital Manila, and the East Asian and Asean summits in Kuala Lumpur in Malaysia.
Saturday was an example of how Mr Obama's carefully choreographed trip had to be shifted on the fly.
In a speech on the sidelines of the Asean summit meant to focus on moving forward on the 12-member Trans-Pacific Partnership (TPP) trade agreement, Mr Obama started off with sharpened language on terrorism as fresh details were emerging about a deadly hotel siege in Mali.
He vowed that the United States would be "relentless", saying: "We'll continue to root out terrorist networks."
Mr Obama's latest flurry of summitry illustrated how his strategy of "rebalancing" US policy towards Asia-Pacific countries has consistently run into the geopolitical reality that the persistently volatile Middle East cannot be ignored.
But even when Mr Obama was able to focus on Asian matters, he sometimes seemed to be caught off guard.
At a townhall-style meeting with South-east Asian youth in Kuala Lumpur - the kind of event where Mr Obama normally gets softball questions from adoring audiences - a young Malaysian told the President the TPP was "a very elitist deal" and pressed him to defend it.
Another questioner challenged Mr Obama to raise corruption and human rights with Malaysian Prime Minister Najib Razak, and the president promised he would "definitely" do that.
But Mr Obama was careful not to lodge any strong public accusations against summit host Datuk Seri Najib - although the US leader brought up the issues with him in private and met civil society activists on on Saturday to hear their concerns.
To be sure, Mr Obama also used his two Asia stops to nudge China over its growing assertiveness in territorial disputes with its neighbors in the South China Sea, which aides said was among his priorities for the trip.
But at the Asean summit, the final chairman's statement avoided any direct criticism of China, reflecting divisions among Beijing's smaller neighbors on how far to go in speaking out, even collectively, against the region's biggest power.
The Philippines, a US treaty ally, had sought stronger language on the South China Sea but did not prevail on all that it wanted, a source close to the matter said. The White House declined on comment.
Mr Obama's meeting last weekend at the G-20 summit in Antalya, Turkey, also produced some unscripted moments.
He had an unscheduled encounter with Russian President Vladimir Putin, and although cameras caught the two leaning in close in intense discussion there was no sign they made any significant progress narrowing their differences over the Syrian conflict.
At the Apec summit in Manila, Mr Obama held his first formal meeting with Canada's young new Prime Minister Justin Trudeau, who basked in the kind of "rock star" treatment that the US President enjoyed at the beginning of his term.
The talks seemed to go well on the surface and could help repair frayed US-Canada ties.
But there was some disappointment among US officials that Mr Trudeau stuck to his campaign pledge to remove Canada's warplanes from the coalition fighting ISIS, despite the view that he could have used the Paris attacks as a reason to hold off on the move.
Mr Obama had also hoped to gain greater attention for his message on the fight against climate change, an important legacy-shaping initiative.
But that too was nearly drowned out by the focus on extremist violence.