President Obama has seen a lot of ups and downs in his approval rating over the past several years. His average weekly rating has ranged from a high of 67 percent shortly after he began his first term in 2009 to a low of 41 percent in 2014; he averaged 46 percent throughout last year.

Related: The Brutal Economic Truth Behind the Rise of Trump

Suddenly, Obama is basking in the glory of a 50 percent approval rating, according to a new analysis by Gallup. That puts him 18 points ahead of where former GOP president George W. Bush stood in the final year of his two-term presidency, and just one point shy of the approval rating of former President Ronald Reagan at the same point in his presidency.

And while there are a number of theories as to why Obama is regaining his popularity, the mostly likely factor is Republican frontrunner Donald Trump.

As the divisive Trump moves ever closer to sewing up the Republican presidential nomination, Obama may be looking better and better to Americans as a statesman and leader – especially among Democrats and independents who have differed with him on many policies.

“The unusual status of the Republican primary race – exemplified in particular by front-runner Donald Trump’s campaign style and rhetoric – may serve to make Obama look statesmanlike in comparison,” Gallup wrote today in offering one possible explanation for the sudden surge. “The campaign season also may activate latent partisan loyalty among those broadly in the Democratic camp.”

Related: Obama’s 'Bipartisan' Budget Is Anything But

After months of take-no-enemies attacks on his political rivals, threats of mass deportations of millions of illegal immigrants, and a vow to prevent most Muslims from entering the country while examining the terrorist threats they might post, Trump more recently has tried to be more “presidential” by toning down his rhetoric. Trump’s new, more subdued rhetorical style will likely be on display Thursday night during the final GOP debate in Florida, ahead of next week’s critical primaries in Florida and Ohio.

But despite his impressive string of victories in 15 primary and caucus contests this year, the bombastic businessman looms as a deeply unpopular figure nationwide. Last month he racked up a 60 percent disapproval rating in Gallup polling – the highest negatives a presidential candidate has reached since the polling organization began asking the question in 1992.

A new NBC News/Wall Street Journal poll shows that six in 10 Americans believe Trump is harming the GOP’s image, and nearly two-thirds have a negative view of him. Moreover, just 53 percent of Republican primary voters said they would be satisfied with Trump as the party’s standard bearer.

There is nothing but bad blood between Trump and Obama. Trump was a leader of the “birther” movement that questioned whether Obama had been born in the United States and was entitled to serve as president. From the very start of his campaign last summer, Trump has denounced Obama as one of the worst president’s in history and dismissed the president’s policies on health care, trade, military spending and anti-terrorist activities as a “disaster” and “disgrace.”

Obama has done little to disguise his contempt for Trump. Last November, Obama blasted Trump’s plan to rid the country of 11 million illegal immigrants, saying it was unfeasible and contrary to U.S. values.

Related: Trump Will Try to Be Presidential Tonight – Good Luck with That

More recently, Obama offered an extended criticism of the GOP presidential field, with a particular focus on Trump. “Being president is a serious job,” Obama told reporters. “It’s not hosting a talk show or a reality show. It’s not promotion. It’s not marketing. It’s hard. And a lot of people count on us getting it right. And it’s not a matter of pandering and doing whatever will get you in the news on a given day.”

Obama joked during a White House press conference with newly elected Canadian Prime Minister Justin Trudeau on Thursday that Canada may have to once again brace for an exit of Americans after the November election “if the guy from the other party wins.”

Related: Trump and Sanders Lash Out at a Common Enemy – Free Trade

While Obama’s overall job approval rating is up, it is still much lower than that of former President Bill Clinton, Obama’s most recent Democratic predecessor. Clinton garnered a 63 percent approval rating in early March 2000 – despite being impeached.