After days of anti-American turmoil in the Muslim world, governments on Sunday looked ahead to a week of trying to make an uneasy accommodation between the anger of their citizens and their desire to convince the United States of their goodwill.

But U.S. diplomatic outposts remained under threat. In Pakistan, at least one protester was killed and 18 were injured Sunday as hundreds of people broke through a barricade in a march to the U.S. Consulate in Karachi, and thousands more rallied in Lahore, where American flags were burned, the Associated Press reported.

In Cairo, the U.S. Embassy returned to full staffing Sunday, a spokesman said, for the first time since Tuesday protests against an anti-Islam video made in the United States sparked turmoil across the Muslim world. But the American diplomatic presence remained reduced elsewhere in the region, meaning that there were fewer routes to repair relations even as they came under the most strain since the wave of democratic change caused last year by the Arab Spring.

In Tunisia, where additional security has been deployed to protect the embassy, the Saturday decision to withdraw nonessential U.S. staff from the mission there appeared to jar Tunisian officials, who have marketed the country as a model of democratic transformation after the peaceful toppling last year of the longtime president, Zine El Abidine Ben Ali. Tunisia’s 2011 protests set the rest of the Arab world afire — and led, in the end, to newfound freedoms for many citizens to express their distaste for their own governments and for the United States.

Leaders have struggled ever since to accommodate those anti-American sentiments.

In an address to the nation Friday night, Tunisian President Moncef Marzouki condemned that day’s violent attack on the U.S. Embassy and an American school, in which four protesters were killed. He said those who organized the protest — widely described here as religious hard-liners known as Salafists — had “crossed a red line.” Yet he also sought to appease the sentiments of those reportedly angered by the video, “The Innocence of Muslims,” saying Tunisia would work with Egypt to sue its producers.

Hedi Ben Abbas, a foreign affairs minister of state whose portfolio includes the Americas, said in an interview Sunday that the Tunisian government “deeply regrets” the American decision to pull its diplomats following the attack, which he insisted was triggered by religious fervor, not anti-American anger.

Security officials, Ben Abbas said, were overhauling their procedures and could now “guarantee” the safety of all diplomatic facilities and foreigners. He said the government, which is headed by a moderate Islamist party that has faced criticism for tolerating religious zealotry, is determined to respond more firmly than it has to previous violent protests staged by Salafists. Dozens of people suspected of involvement in the riot have been arrested, according to local news reports.

Friday’s demonstration, Ben Abbas said, “was for us the end of the game.”

“We understand that there was a failure,” he said of security measures at the embassy and school. “Let’s be clear, the plan we put in place was not enough. It was weak.”

“The government of America cannot be responsible for the movie,” he said. Similarly, he said, “the Americans cannot blame the Tunisian government for the behavior” of protesters.

“The United States should trust us again,” Ben Abbas said. “We need them more than ever to support democracy.”

American support comes in many forms in the region, ranging from diplomatic relations to aid to investment. Its future is being newly evaluated.

In Egypt, the government of President Mohamed Morsi and the Obama administration had been hammering out the final points of an aid deal that could forgive a sizable chunk of the more than $3 billion that the Egyptian government owes to the United States. But with embassy activity largely reduced last week and the United States initially disappointed at the Egyptian government’s response to the protests, the final outcome of the aid talks remains uncertain, as does congressional support for a deal.

Morsi has pursued a diplomatic path far different from former president Hosni Mubarak, who hewed closely to the U.S. line, or even from the interim military-dominated government that ran the country from February 2011 until Morsi took power at the end of June. On Sunday, Morsi met in Cairo with Sudanese President Omar al-Bashir, despite an International Criminal Court warrant for the Sudanese leader’s arrest — and despite a sharp decline in relations between Sudan and the United States since Friday, when the U.S. Embassy was attacked by protesters in Khartoum.

The Sudanese government refused Saturday to allow U.S. Marines to secure U.S. diplomats there, and the State Department pulled out nonessential personnel in response.

Separately, in Libya, where U.S. Ambassador J. Christopher Stevens was killed Tuesday along with three other U.S. diplomatic staffers in an attack on the consulate in Benghazi, President Mohammed el-Megarif on Sunday announced the arrests of about 50 people in connection with the attack. In an interview with CBS News, Megarif said that “foreigners,” some from Mali and Algeria, had participated in the attack and that he had “no doubt” that it was preplanned. But on the same program, U.S. Ambassador to the United Nations Susan Rice said that officials had seen no evidence to support such a conclusion.

Brulliard reported from Tunis.