KAMPALA (Reuters) - Uganda’s veteran president vowed to fight corruption and inefficient bureaucracy on Thursday as he was sworn in to a fifth term in office, but some Western officials walked out of the ceremony when he mocked the International Criminal Court.

Slideshow ( 4 images )

In his inaugural address, President Yoweri Museveni, 71, told heads of state, diplomats and other guests he planned to fight corruption and impose discipline on inefficient bureaucrats during his next five-year term of office, which will extend his rule to 35 years.

But Museveni offended U.S., European Union and Canadian officials in attendance when he criticized the International Criminal Court in his welcoming remarks as “a bunch of useless people.”

Among guests at the inauguration was Sudan’s President Omar Hassan al Bashir, who attended despite international warrants from the ICC seeking his arrest for crimes against humanity.

“In response to President Bashir’s presence and President Museveni’s remarks, the United States delegation, along with representatives of the European Union countries and Canada, departed the inauguration ceremonies to demonstrate our objection,” U.S. State Department spokeswoman Elizabeth Trudeau told a briefing in Washington.

“We believe that walking out in protest is an appropriate reaction to a head of state mocking efforts to ensure accountability for victims of genocide, war crimes and crimes against humanity,” Trudeau said.

Museveni was re-elected to a fifth term in February after a disputed vote and protests against his rule. Authorities blocked Facebook, Twitter, Whatsapp and other social media, citing security concerns ahead of the inauguration ceremony in Kampala.

The president officially won 60 percent of the votes in the February election, which the opposition said was rigged. Protests erupted, leading to clashes with police and dozens of arrests. Officials say the vote was free and fair.

Since coming to power in 1986, Museveni is credited with restoring order after years of chaos. But experts say the growing economy has not kept up with a rising population, while critics complain about corruption and a clampdown on dissent.

“These two mistakes, corruption and delays in decision making, irritate the public and frustrate the investors,” Museveni told visiting African presidents and other dignitaries.

“This time I will act directly so as to discipline the public service as we discipline the army,” the rebel-turned-statesman said, adding that he would work to boost agricultural output in the coffee and tea exporting nation.

Police arrested opposition leader Kizza Besigye after a street protest on Wednesday. Besigye, who heads the Forum for Democratic Change party, won 35 percent of the vote. He has been under house arrest on and off since then.

The head of Uganda’s telecommunications regulator Godfrey Mutabazi said security agencies had asked that access to social media websites be blocked “to limit the possibility of terrorists taking advantage” of visits by dignitaries.

In the days leading up to Museveni’s swearing-in, authorities also placed more security patrols on the streets of Kampala and residents said there was a strong presence of military and police on Thursday.

The government also banned live television or radio coverage of protests in the wake of the election, which EU monitors said was held in an intimidating atmosphere. The EU also said the electoral body lacked independence and transparency.

Opposition to the president is strongest among youths in urban areas, such as Kampala, where frustration has been fuelled by unemployment, corruption and crumbling public services.