Sri Lanka’s new president, Maithripala Sirisena, was sworn in on Friday after final results from historic polls made him the clear victor over the incumbent Mahinda Rajapaksa.

The result, which surprised many onlookers, ends a decade of rule that critics said had become increasingly authoritarian and marred by nepotism and corruption.

Analysts described the election as the most significant for decades in the island nation and a last chance for democracy. Many predicted widespread violence before, as well as after, polling. In the event, however, the transfer of power appeared to proceed smoothly.

“With this victory we will implement the 100-day programme in our election manifesto,” Sirisena told jubilant crowds in Colombo after his swearing-in. Sirisena had promised to change Sri Lanka’s constitution to drastically reduce the power of the president and return the country to a parliamentary system with a prime minister as its leader.

Sirisena also promised that he would not run again for president. He thanked Rajapaksa for conceding defeat but called for future campaigns to be “much more mature” and blasted the state media for its coverage.

“Even though they carried out character assassination and vilified me, I can say I had the maturity to bear it all as a result of my long political experience,” he said.

He took the oath of office with senior supreme court Justice Kanagasabapathy Sripavan, bypassing the country’s chief justice, who was installed by Rajapaksa in a widely criticised move to expand his authority even more.

Sirisena then swore in opposition leader Ranil Wickremesinghe as the prime minister.

Rajapaksa, who had called early elections in November confident of a win, conceded defeat on Friday morning and vacated his official residence hours before the official announcement.

Sirisena, 63, received 51.2% of the votes in Thursday’s election and Rajapaksa got 47.5%, said the elections commissioner, Mahinda Deshapriya.

The veteran politician Sirisena, who resigned from the government to lead the opposition, told his supporters that they shouldn’t “even hurt anybody’s feelings”.

“The honour of this victory is in your peaceful conduct,” Sirisena said.

The result ends the rule of the longest-serving leader in the region.

Celebratory firecrackers could be heard exploding in Colombo, the cultural and commercial capital, after the president’s office said Rajapaksa had met the leader of the opposition to accept the victory of his challenger.

Sirisena announced his candidacy hours after Rajapaksa, 69, called the election. The farmer-turned-politician united a fractured opposition and told voters he would root out corruption and undo unpopular constitutional reforms that have concentrated powers under the presidency.

In successive campaign speeches he attacked the Rajapaksa clan for seeking to perpetuate dynastic rule. Three Rajapaksa brothers held senior posts and the president’s 28-year-old son was widely seen as being groomed as an heir.

Observers said the unexpected challenge from the former health minister destabilised the incumbents.

“It definitely threw them. They’ve not been on their game,” said Alan Keenan of the International Crisis Group.

However, Sirisena, like Rajapaksa from the Sinhala majority, has not signalled any departure from the previous government’s hard line on reconciliation with the country’s Tamil minority.

Though significantly calmer than elections in 2010, the campaign was nonetheless marred by more than 400 incidents of violence, according to monitors, and allegations of fraud and intimidation.

Rajapaksa won handsomely in 2010, surfing a wave of popularity after overseeing a final bloody victory over ethnic Tamil separatists and ending a crippling 26-year civil war. He was seeking an unprecedented third term, having pushed through a constitutional amendment.

“We should also not forget President Rajapaksa was beneficial to the country, especially during his first term,” said Nayanajith Thilakarathne, a vehicle parts dealer in Colombo.

The decision to seek early polls may have been more an acknowledgement of growing unpopularity than a statement of strength, however. The benefits of economic growth have failed to reach the poor, especially in rural areas.

Corruption and apparent nepotism also led to anger.

“Good governance is the most important issue now. The common man should feel that rule of law applies to everyone across the board without any discrimination,” said Fritz Fernandez, a lecturer in the capital.

An adamant refusal to move on reconciliation with the Tamil minority and growing sectarian violence denied Rajapaksa votes among other constituencies.

Votes from the ethnic Tamil-dominated former war zone in the north of the country and Muslim-dominated areas appear to have played a key role in Sirisena’s victory.

According to one report, in the Tamil stronghold of Kilinochchi, Sirisena got nearly three-quarters of votes cast.

Rajapaksa fell out with the west over allegations of war crimes involving the deaths of many thousands of Tamil civilians in the final phases of the civil war in 2009, and refused to cooperate with a UN-mandated investigation, becoming increasingly close to China. He was also blamed for successive crackdowns – including alleged murders – of opponents, human rights campaigners and other critics.

The opposition has promised to address international concerns over war crimes and normalise relations with western nations as well as India.

Narendra Modi, the Indian prime minister, said he had spoken to Sirisena to congratulate him.

The first foreign dignitary to travel to Sri Lanka after the polls will be Pope Francis, who arrives next week for a three-day visit.

The new president will have to lead a potentially fractious coalition of ethnic, religious, Marxist and centre-right parties, however and any prolonged political instability will open the way for a Rajapaksa comeback. He has also given no indication that he will differ significantly from his predecessor on issues such as post-war reconciliation or on his broadly rightwing economic policy.

There are still fears of trouble ahead.

“Our culture is such that there is always a chance of post-election violence,” said Paikiasothy Savaranamuttu, of the Colombo-based Centre for Policy Alternatives, before the vote.