Barack Obama has called Donald Trump's repeated efforts to repeal Obamacare "aggravating."

Speaking at a summit hosted by billionaires Bill and Melinda Gates to coincide with the United Nations General Assembly, the former US President urged people not to be discouraged by unsteady progress as they work on pressing global issues.

He said the real problems facing the world "can't discourage any of us from the belief that individually and collectively, we can make a difference."

He spoke about some of his own frustrations after leaving office, including the battle over the Affordable Care Act.

High school students freak out when Barack Obama surprises them to give message of encouragement

The US President and Republican leaders in the US Senate are again pushing to repeal central elements of the law after repeated failures, with a vote possible next week.

"When I see people trying to undo that hard-won progress for the 50th or 60th time with bills that would raise costs or reduce coverage... it is aggravating," Mr Obama said.

"It's certainly frustrating to have to mobilise every couple of months to keep our leaders from inflicting real human suffering on our constituents."

Barack Obama's best moments in the White House Show all 11 1 /11 Barack Obama's best moments in the White House Barack Obama's best moments in the White House May 19, 2009 “The President was leaving the State Floor after an event and found Sasha in the elevator ready to head upstairs to the private residence. He decided to ride upstairs with her before returning to the Oval Office,” Peter Souza Barack Obama's best moments in the White House Oct. 26, 2012 President Barack Obama pretends to be caught in Spider-Man's web as he greets the son of a White House staffer in the Outer Oval Office Peter Souza Barack Obama's best moments in the White House “A National Security staffer, Carlton Philadelphia, brought his family to the Oval Office for a farewell photo with President Obama. Carlton’s son, Jacob, softly told the President he had just gotten a haircut like President Obama, and asked if he could feel the President’s head to see if it felt the same as his.” Peter Souza Barack Obama's best moments in the White House March 21, 2010 The President, Vice President and senior staff applaud after watching on television the House vote on H.R. 4872 for health care reform, in the Roosevelt Room of the White House Peter Souza Barack Obama's best moments in the White House Dec. 3, 2009 President Barack Obama fist-bumps custodian Lawrence Lipscomb in the Eisenhower Executive Office Building following the opening session of the White House Forum on Jobs and Economic Growth Peter Souza Barack Obama's best moments in the White House Sept. 22, 2015 "The Obama family and Biden family greet Pope Francis as he arrives in the United States for the first time at Joint Base Andrews," Sept. 22, 2015. Peter Souza Barack Obama's best moments in the White House Feb. 21, 2014 President Barack Obama and Vice President Joe Biden participate in a "Let's Move!" video taping on the Colonnade of the White House, Feb. 21, 2014 Peter Souza Barack Obama's best moments in the White House Feb. 18, 2016 President Barack Obama watches First Lady Michelle Obama dance with 106-Year-Old Virginia McLaurin in the Blue Room of the White House prior to a reception celebrating African American History Month, Feb. 18, 2016 Peter Souza Barack Obama's best moments in the White House Jan. 21, 2013 "The President and First Lady wave to supporters as they ride in the inaugural parade. I had asked the President if I could ride in the presidential limousine and the President joked, 'But Michelle and I were planning to make out," Jan. 21, 2013. Peter Souza Barack Obama's best moments in the White House Barack Obama and former First Lady Michelle Obama share a private moment in a freight elevator at an Inaugural Ball, January 2009 all pics: Pete Souza Barack Obama's best moments in the White House Barack Obama rests his hand on the bible that President Lincoln used for his swear-in, being held by his wife Michelle Obama as he is sworn in as the 44th President of the United States of America Rex

Opponents of Mr Obama's health law to expand coverage for more Americans have criticised it as being costly and ineffective, arguing people shouldn't be forced to buy health insurance.

Discussing climate change, Mr Obama said the federal government wasn't "as engaged in these efforts as I would like."

Mr Trump has said he will pull out of the Paris climate change accord, an agreement the Obama administration worked with other countries to fashion.

But the response to setbacks, Mr Obama said, had to be "to reject cynicism and reject pessimism and push forward."

He said: "Rather than be daunted by those challenges, those challenges should inspire us and excite us because it gives us an opportunity to make our mark on the world."