President Donald Trump’s secretary of state, Rex Tillerson, described his boss as a “moron” over the summer as tensions grew between the State Department and White House, according to a report.

Tillerson made the comment to other officials after a tense July 20 meeting at the Pentagon with members of the administration’s national security team and Cabinet members, three people familiar with the incident told NBC News Wednesday.

Tillerson’s insult came the same week Trump attacked Attorney General Jeff Sessions in a series of tweets that called him “beleaguered” and asked why he wasn’t investigating Trump’s campaign rival, Hillary Clinton.

A day before the incident, Trump had gone on a tirade in an interview with The New York Times about how he regretted hiring Sessions because the attorney general had stepped aside from heading the Russia investigation because of ethical conflicts.

Tillerson called Trump’s comments about Sessions unprofessional and appeared to be close to quitting, CNN reported, after speaking with two sources close to the secretary of state that weekend. Tillerson had traveled back to his home in Texas for his son’s wedding.

State Department spokeswoman Heather Nauert told reporters at the time that Tillerson was “just taking a little time off.”

Related: Trump didn’t contradict Tillerson on North Korea, adviser says

But sources said that Tillerson had in fact threatened not to return to Washington, according to NBC, and the three officials who were present or briefed on the Pentagon meeting told NBC News there were other factors at play as well.

At a July 19 meeting in the White House Situation Room, Trump discussed his policy on Afghanistan, musing about firing his top U.S. commander in the war and likening the decisions he needed to make on troop numbers to renovating a luxury New York restaurant. The following day, after a second meeting, Tillerson is believed to have insulted the president. 

When Tillerson returned to Washington the following week, Vice President Mike Pence arranged a meeting with him, three officials told NBC. One described it as a “pep talk.”

Another senior administration official said Tillerson’s allies in the Cabinet, including Defense Secretary James Mattis and then-Secretary of Homeland Security John Kelly, begged “him to stay.”

The former Exxon Mobil CEO is overseeing a massive reorganization of his department after Trump laid out plans in his March budget proposal to cut $10 billion from the State Department’s $47 billion in funding.

Tillerson’s communications adviser, R.C. Hammond, said at the time that the thought of quitting “never crossed” the secretary of state’s mind.

Hammond told NBC that Tillerson didn’t call Trump a “moron” and that he didn’t know the details of the secretary’s meeting with Pence. Hammond also said he wouldn’t characterize his boss’s conversations with Mattis and Kelly as pleas for him to stay.

Trump has repeatedly contradicted Tillerson’s policy approaches on everything from whether the U.S. should mediate in a dispute between Qatar and Saudi Arabia to North Korea's nuclear weapons program. The secretary has also quarreled with senior White House staff after Trump and the White House rejected a number of his hiring decisions.

The relationship between Trump and his top diplomat remains visibly strained. In a series of tweets this past Sunday, Trump contradicted Tillerson’s approach to pursuing talks with North Korea over its nuclear weapons program. The secretary had just met with Chinese officials Saturday in Beijing, where he spoke about America’s approach to dealing with the regime and said, “We’ve made it clear that we hope to resolve this through talks.”

On Sunday, Trump tweeted, “I told Rex Tillerson, our wonderful Secretary of State, that he is wasting his time trying to negotiate with Little Rocket Man,” a nickname the president has given to North Korean dictator Kim Jong Un.

“Save your energy Rex,” Trump wrote. “We’ll do what has to be done!”