Sri Lanka's president reappointed Ranil WickremesFinghe as prime minister on Sunday, nearly two months after firing him and setting off a long political stalemate in the South Asian island nation.

The move promises to ease the crisis, but could also be the beginning of a difficult cohabitation between Wickremesinghe and President Maithripala Sirisena, who are now in rival camps. A new cabinet is expected to be sworn in soon.

Wickremesinghe's United National Party said on its official Twitter account that Wickremesinghe took the oath before Sirisena. The swearing in took place privately, with only a few lawmakers in attendance.

"Now I will assume duties of the office of prime minister," Wickremesinghe told cheering supporters gathered at his official residence after he was sworn in.

'The country went backward'

"Unfortunately, during the past few weeks, the progress of this country and the development programs that we undertook were stalled," he said. "Not only that, the country went backward. Today we commit firstly to bring back normalcy and resuming the development program."

Sirisena abruptly dismissed Wickremesinghe on Oct. 26 and appointed former strongman president Mahinda Rajapaksa in his place. Wickremesinghe insisted his removal was unlawful. Rajapaksa, meanwhile, failed to get Parliament's approval, losing two no-confidence votes.

Sri Lanka's President Maithripala Sirisena abruptly dismissed Wickremesinghe on Oct. 26 and appointed former strongman president Mahinda Rajapaksa in his place. (Dinuka Liyanawatte/Reuters)

Still, Rajapaksa continued to hold office with Sirisena's support, and his opponents went to court. The Court of Appeal suspended Rajapaksa and his cabinet from functioning in their offices. Rajapaksa asked the Supreme Court to lift the suspension, but it refused and extended the suspension until mid-January, forcing Rajapaksa to resign on Saturday.

Sri Lanka had been without a government from the time Rajapaksa was suspended by the Court of Appeal and was facing the danger of being unable to spend government money from Jan. 1 without a budget. It is also committed to repay $1 billion US in foreign debts in January.

'We can be proud'

"We can be proud of the way our Parliament and Supreme Court did their duties according to the law," Wickremesinghe said Sunday, adding that the Supreme Court had strengthened the freedom of the citizens by interpreting the law accurately.

"We all need a normal life, we need our progress and it is to this that we are committed," he said.

A supporter of Sri Lanka's then-ousted Prime Minister Ranil Wickremesinghe shouts slogans during a protest against his removal in October. (Dinuka Liyanawatte/Reuters)

Sirisena was health minister in Rajapaksa's cabinet when he defected to join Wickremesinghe and challenge Rajapaksa in the 2015 presidential election. After winning the election, he formed a government with Wickremesinghe as prime minister, but the two leaders started to have differences.

Sirisena opposed Wickremesinghe's liberal economic policies and his moves to investigate alleged abuses during Sri Lanka's long civil war, which ended in 2009. He had insisted on not reappointing Wickremesinghe even though Rajapaksa lost the two no-confidence votes.