As he prepares his exit from the White House, President Barack Obama is taking a look back at his foreign policy legacy and in an extensive report out Thursday, the president has recounted some of his more confrontational encounters with world leaders.

Wide-ranging interviews with The Atlantic's Jeffrey Goldberg give an inside look at the relationship between Mr. Obama and Israeli Prime Minister Benjamin Netanyahu, one particular head of state the president has had tense relations with over the years.

During one meeting between the two leaders, Netanyahu reportedly attempted to "lecture" the president over the politics of the Middle East.

Get Breaking News Delivered to Your Inbox

The president "felt that Netanyahu was behaving in a condescending fashion," according to Goldberg's report, and was also avoiding discussions of the peace process.

Mr. Obama said he interrupted the Israeli leader: "Bibi, you have to understand something," he said. "I'm the African American son of a single mother, and I live here, in this house. I live in the White House. I managed to get elected president of the United States."

He added: "You think I don't understand what you're talking about, but I do."

Most recently, the two leaders have clashed on the contentious Iran nuclear deal brokered by the United States and five other world powers.

And Nethanyahu isn't the only world leader that has irked the president during his years in the White House.

According to Goldberg's report, Obama once saw hope in Turkish president Recep Tayyip Erdoğan as a moderate Muslim leader but now sees him as a "failure" and an "authoritarian."

The president has also tried to settle some tensions with Jordan's King Abdullah II.

During a 2014 NATO summit, Mr. Obama took Abdullah aside and confronted him over grievances the Jordanian ruler had reportedly aired about his presidency.

Goldberg wrote in his report that Mr. Obama "told the king that if he had complains, he should raise them directly." Abdullah, for his part, "denied that he had spoken ill" of the president.