At a campaign fundraiser in New York City in March this year, Obama, the first black American to occupy the White House, cast his candidacy for re-election in historical terms.
And in doing so, he drew an implicit comparison between his aspirations and the achievements of the iconic independence leaders in South Africa and India.
"The civil rights movement was hard. Winning the vote for women was hard. Making sure that workers had some basic protections was hard," Obama had said.
"Around the world, Gandhi, Nelson Mandela, what they did was hard. It takes time. It takes more than a single term. It takes more than a single president. It takes more than a single individual," he said while talking about how difficult it is to bring about 'change' in politics.
Obama went on to say that citizens needed to "keep believing" and fighting for those beliefs.
The fundraiser speech at New York likening himself to Gandhi and Mandela was described by media as extraordinary. But questions were asked whether the comparison was a "delusion of grandeur."
Obama in his speeches has often said that Gandhi has inspired Americans and African Americans, including Dr Martin Luther King. During a school interaction in the US, Obama had said once that if it were possible, he would have loved to have dinner with Mahatma Gandhi.
Obama had also invoked Gandhi in his speech at the annual session of the UN General Assembly in New York in September this year when he said that the controversial 'anti-Islam film' was no excuse for attack on the US.
Obama, who is a self-confessed hero of Gandhi, had invoked the Indian freedom leader's words in his United Nations General Assembly address as he remembered US Ambassador to Libya who was killed in violent protests that erupted in the aftermath of the anti-Islam film, saying the "crude and disgusting" video was no excuse for an "attack on America".
Obama took the opportunity to explain that tolerance is at the core of American democracy and freedom.
He opened his address by honouring slain Ambassador Chris Stevens, "Today, we must affirm that our future will be determined by people like Chris Stevens, and not by his killers. Today, we must declare that this violence and intolerance has no place among our United Nations." "It is time to heed the words of Gandhi: 'Intolerance is itself a form of violence and an obstacle to the growth of a true democratic spirit.'" he had said.
After visiting the house of Mahatma Gandhi in Mumbai in November in 2010, Obama had hailed the Father of the Nation as "a hero not just to India but to the world".
Obama had always looked to Gandhi for inspiration. The President in his speeches has often cited Gandhi has having a major influence on him.
"I am filled with hope and inspiration as I have the privilege to view this testament to Gandhi's life. He is a hero not just to India but to the world," Obama, who was struck with awe, wrote in the visitor's book at the Mani Bhavan in Mumbai with a cupboard teetering with books of the Mahatma in the background.
Image: US President Barack Obama with wife Michelle at Mani Bhavan during his trip to Mumbai in November 2010