"I will abide by and enforce the constitution and the laws, and will dedicate all my energy to the defence and consolidation of independence and national unity," he said.
Members of the former ruling party Fretilin, which has protested against the president's decision to appoint Gusmao premier, did not attend the ceremony in the capital, Dili, which took place under tight security.
Jose Ramos-Horta, the former prime minister who has now completed a job swap with Gusmao, invited a coalition put together by the former president to form a government on Monday in the wake of the June 30 election which proved inconclusive.
The coalition holds 37 seats in parliament.
"We have been telling the supporters to avoid violence, but I think in that situation they will not trust us any longer"
Arsenio Bano, Fretilin vice-president
Fretilin, which won 21 seats in the 65-seat parliament, the most seats for an individual party but not enough to govern, says it should have been asked to lead and plans to fight the decision in the courts.
Gusmao's appointment triggered violence by Fretilin loyalists in which at least six people were injured and government buildings were torched.
And there were fears of fresh violence on Wednesday after Fretilin said it no longer had control of its supporters.
Arsenio Bano, Fretilin's vice-president, said on Tuesday: "We can appeal but we are not in control."
"We have been telling the supporters to avoid violence, but I think in that situation they will not trust us any longer, because some of them are saying that we vote for you and we win the election, and you don't take up the position."
Thousands of international peacekeepers and UN police say they have largely been able to control the unrest.
Gusmao's deputy and the country's new government ministers were to be sworn in later on Wednesday.