Abuja, Nigeria (CNN) Nigeria's President Muhammadu Buhari has been declared winner of the country's elections, according to the electoral commission who said he polled 56 percent of the votes.

Buhari, who first came to power in 2015 after defeating then-incumbent Goodluck Jonathan, defeated his main challenger Atiku Abubakar by a margin of nearly four million votes in results announced by the Independent Electoral Commission (INEC), in Abuja, Nigeria's capital.

Buhari of the All Progressives Congress (APC) claimed 15,191,847 (56%) while Abubakar received 11,262,978 (41%) of votes in the weekend election, according to the commission, which finished counting state-by-state results on Tuesday.

"The new administration will intensify its efforts in security, restructuring the economy and fighting corruption," Buhari said after his victory was officially announced

Voting apathy

Abubakar, of the People's Democratic Party, (PDP) rejected the election results calling the electoral process "militarized" and a "disservice" to Nigeria's democracy.

"If I had lost in a free and fair election, I would have called the victor within seconds of my being aware of his victory to offer not just my congratulations, but my services to help unite Nigeria by being a bridge between the North and the South," Abubakar said.

He added: "I hereby reject the result of the February 23, 2019 sham election and will be challenging it in court."

Abubakar, who was Vice President from 1999 to 2007, has run for President four times. His candidacy was dogged by allegations of corruption stemming from his time in office, allegations he has consistently denied.

Buhari won in 19 of the 36 states with Atiku gaining the upper hand in 17 states and in the capital, Abuja.

Delivering Africa's largest democracy was never going to be an easy task, but Nigeria's elections were marred by poor logistics arrangements, which led to the electoral commission moving the presidential election date by one week -- just hours before the polls opened.

On the day itself, there were reports of voter intimidation, ballot boxes snatched at polling stations and voting papers burned in at least one place. Nigerians were left waiting for several hours at polling units across the country for voting materials to turn up.

Consequently, there was widespread voting apathy, leading to Nigeria's lowest voter turnout in 20 years, with INEC reporting that just 27 million votes were cast out of 84 million people who registered to vote.

In Lagos, the sprawling megacity of nearly 20 million inhabitants, only 1.1 million people voted, according to INEC figures.

The election turnout was 35.6 percent, the electoral commission said, which compared with 44 percent in the 2015 elections.

At least 39 people were killed in election-related violence , according to the Situation Room, a coalition of more than 70 civic organizations that monitored the elections. One of those who died was Ibisaki Amachree, a mother of two, an election volunteer caught in the crossfire between the Nigerian army and armed militia in Rivers State.

The Situation Room, citing data from analysis firm SBM Intelligence, said most of the deaths occurred in the southern oil-rich state.

But despite the violence, US observers from the International Republican Institute and the National Democratic Institute (IRI/NDI) said that although the deaths were tragic, they should be placed in the broader context.

"We don't want to overemphasize the deaths," the IRI's John Tomaszewski told CNN Monday.

"We understand the contextual relationship. Violence happens every day here. It's not just on Election Day."

Election violence

The death toll reported in the presidential vote is lower than in previous national elections. The International Crisis Group said at least 100 people were killed in violence that broke out during and after the 2015 election and Human Rights Watch reported 800 killed in the post-election violence of 2011.

Buhari first came to power as a military leader in a coup in 1983 before being ousted himself 20 months later in another coup.

Photos: In photos: Nigerian President Muhammadu Buhari Photos: In photos: Nigerian President Muhammadu Buhari Nigerian President Muhammadu Buhari arrives for an anti-corruption summit in London in May 2016. Hide Caption 1 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Before he was Nigeria's President, Buhari was an officer in the country's army. Here, he stands next to Saudi Sheikh Ahmed Zaki Yamani, center, and Swedish King Carl Gustaf during an OPEC summit in Stockholm, Sweden, in 1977. Hide Caption 2 of 19 Photos: In photos: Nigerian President Muhammadu Buhari As an army general, Buhari gained power in Nigeria after a coup in 1983. He was the country's head of state until 1985, when another coup forced him out. Hide Caption 3 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari ran for president in 2003 but lost the election. He also ran unsuccessfully in 2005, 2007 and 2011 before winning in 2015. Hide Caption 4 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari salutes a crowd during a presidential rally in 2011. Hide Caption 5 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari embraces his opponent, President Goodluck Jonathan, after they pledged to hold peaceful "free, fair and credible" elections in 2015. Hide Caption 6 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari casts his ballot in March 2015. Hide Caption 7 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari greets a crowd as he is sworn in to office in May 2015. Hide Caption 8 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari is greeted by German Chancellor Angela Merkel during the G-7 summit in Germany in June 2015. Hide Caption 9 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari shakes hands with US President Barack Obama during a White House meeting in July 2015. The two leaders were expected to discuss various topics, including the fight against the Boko Haram terrorist group. Hide Caption 10 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Britain's Queen Elizabeth II talks to Buhari during a reception in Malta in November 2015. Hide Caption 11 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari inspects a Chinese honor guard during a visit to Beijing in April 2016. Hide Caption 12 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Patricia Scotland, secretary-general of the British Commonwealth, speaks with Buhari at the start of an anti-corruption summit in London in May 2016. Hide Caption 13 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari leaves the stage during a US-Africa Business Forum in New York in September 2016. Hide Caption 14 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari meets with Chibok schoolgirls during their visit to the presidential villa in Abuja, Nigeria, in October 2016. Boko Haram militants handed over 21 schoolgirls to authorities after a series of negotiations, Nigeria's government said. It was the first mass release of any of the girls who were kidnapped from their school in 2014. Hide Caption 15 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari arrives at a hotel in Banjul, Gambia, to meet with West African leaders in December 2016. The meeting convened around a joint effort to persuade Gambia's longtime leader, Yahya Jammeh, to accept his election defeat and step down from power. Hide Caption 16 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari disembarks from a plane upon his return to Nigeria in March 2017. He had spent nearly two months in London receiving medical treatment for an undisclosed illness. Hide Caption 17 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari listens to US President Donald Trump during their joint press conference at the White House in April 2018. The two leaders also met in the Oval Office to discuss a range of bilateral issues. Hide Caption 18 of 19 Photos: In photos: Nigerian President Muhammadu Buhari Buhari waves to a crowd of supporters during a campaign rally in Lagos, Nigeria, in February 2019. Hide Caption 19 of 19

He ran unsuccessfully for President three times from 2003 to 2011, and was elected into office four years ago as the first opposition candidate to defeat an incumbent in Nigeria.

Buhari swept to power promising to tackle endemic corruption and root out the terror group Boko Haram.

Although Buhari is perceived as having a zero tolerance reputation in his fight against corruption, Transparency International said Nigeria has "neither improved nor progressed in the perception of corruption in the public administration in 2018," in its latest Corruptions Perception Index

The fight against Boko Haram also seems to have stalled as the jihadi group appears strengthened and one faction has forged stronger links with ISIS to create the Islamic State of West Africa Province, and the group is staging attacks on military bases and displacing thousands of Nigerians

A flagging economy

Buhari is now faced with the daunting task of reviving a flagging economy that has been affected by the global oil price crash from its $100 high to $40, leaving the country's major revenue source depleted.

Although the country has emerged from recession and GDP grew slightly, 91 million Nigerians now live in poverty, the highest number of impoverished people in the world, overtaking India to move into the top spot in 2018, according to The Brookings Institution

Buhari will also need to show the Nigerian people that he has put his health problems behind him.