When he takes the oath of office next week, Rajapaksa will become prime minister for the fourth time in his career.
However, it has not been a smooth sailing for Rajapaksa, a street-fighter politician who entered Parliament when he was just 24, becoming the youngest lawmaker. After losing the seat in 1977, he focused on his law career until reentering Parliament in 1989.
He served as labour minister (1994-2001) and minister of fisheries and aquatic resources (1997-2001) under President Chandrika Kumaratunga, who appointed him as prime minister after the general election of April 2004, when the United People's Freedom Alliance won a majority.
He was chosen as the Sri Lanka Freedom Party's presidential nominee in November 2005. Shortly after his victory in the election, Rajapaksa announced his intention to crush the Liberation Tigers of Tamil Eelam (LTTE), which had established a de facto government in northern Sri Lanka.
Ending the nearly 30-year-long bloody civil war with the LTTE, where all his predecessors had failed, Rajapaksa became a hero and used it to return to power with a thumping win in 2010, leading to political analysts labelling him "a man with a midas touch."
He had acknowledged a number of times that his crowning moment in his over four-decade political career was the victory against Tamil Tigers.
However, he was accused of condoning sexual violence and extrajudicial killings allegedly by Lankan security forces during the civil war, which ended in May 2009. He was also accused of approving a crackdown on dissent.
During his presidency from 2005 to 2015, Rajapaksa consolidated his position. The Constitution was changed to allow him to serve a third term, and his three brothers - Gotabaya, Basil and Chamal - were awarded influential positions, leading to accusations that he was running the country like a family firm.
His domestic popularity appeared to wane during 2014 because of rising prices and concerns of corruption and abuse of power, and, in an attempt to secure another presidential term before losing support, he again called for an early presidential poll. But his political gamble backfired and he was defeated by former ally Maithripala Sirisena in the elections in 2015.
During his tenure as president, Rajapaksa concluded several key infrastructure deals with China, raising concerns in India and the West.
Critics say it was due to Rajapaksa that the country has fallen into the "Chinese debt trap". The strategic Hambantota port, which was funded by a Chinese loan during his regime, was leased to Beijing on a 99-year debt-for-equity swap in 2017 after the country failed to pay off the debt.
In 2015, Parliament restored a constitutional two-term limit on the presidency barring Rajapaksa from contesting again. In August, Rajapaksa was elected to Parliament.
After their defeat in 2015, the Rajapaksas were battling arrests and corruption cases in court. There were scores of graft cases filed against them.
Three years later, Rajapaksa was briefly appointed as the prime minister in October, 2018 by then President Sirisena, who sacked Prime Minister Ranil Wickremesinghe in a controversial move that plunged the country into a constitutional crisis. Rajapaksa resigned on December 15 after the Supreme Court declared that the dissolution of Parliament by Sirisena was "illegal".
Later, Rajapaksa and his supporters in Parliament defected from the ruling party and joined the SLPP, founded by his brother Basil, and he formally became the Leader of the Opposition.
The Easter bombings on April 21, 2019 that killed over 250 people was a turning point in Lankan politics as the then government appeared to have failed to act though it had advance intelligence report of an impending terror attack.
The Rajapaksas lambasted the government of President Sirisena and Prime Minister Wickremesinghe for the failure on the security front.
The SLPP also announced the presidential candidacy of Rajapaksa's younger brother Gotabhaya, who had served as his defence minister in the final years of the civil war against the LTTE.
The brother-duo promised security to Sri Lankans who became worried about Islamic extremism in the Buddhist-majority country.
Gotabhaya won the presidential election in 2019 and appointed Rajapaksa as the prime minister of the caretaker cabinet until the general election. Rajapaksa visited India in February on his first official visit abroad after being appointed to the office.
Prime Minister Narendra Modi was among the first world leaders to congratulate Rajapaksa on his victory on Thursday and said the two countries will work together to further advance all areas of bilateral cooperation and to take their special ties to ever newer heights.