Barack Obama returned to the campaign trail on Thursday for the first time since he left the White House, urging voters in New Jersey to reject the "politics of division" by supporting Democrats in next month's state elections.

Without mentioning Donald Trump by name, Mr Obama said New Jersey could send a powerful signal about the type of politics it wants by voting for Democrat Phil Murphy in the November 7 governor race.

"You're going to send a message to the country and send a message to the world that we are rejecting a politics of division, we are rejecting a politics of fear, that we are embracing a politics that says everybody counts," Mr Obama told a cheering crowd in Newark that chanted: "Four more years."

Opinion polls show Mr Murphy, a former investment banker and U.S. ambassador to Germany, has a comfortable lead on Republican opponent Kim Guadagno, the New Jersey lieutenant governor, who is hindered by the unpopularity in the state of Mr Trump and Republican Governor Chris Christie.

But Mr Obama said no one should assume a victory is in the cards, making an indirect reference to Democrat Hillary Clinton's surprise loss last year in the presidential race.