Alex Wong/Getty Images(WASHINGTON) — Former Secretary of State Rex Tillerson told lawmakers in May that President Donald Trump faced a “steep learning curve” dealing with the U.S. relationship with Russia and immigration laws, according to a transcript of his closed-door interview released by a House committee on Thursday.

The former ExxonMobil CEO-turned-diplomat’s testimony to the House Foreign Affairs Committee are some of his most candid and extensive comments on his rocky tenure in the Trump administration.

In seven hours behind closed doors with the committee, Tillerson said Trump was “learning a lot along the way” about the United States’ relationship with Russia. He said Trump “didn’t know a lot” about “the legal aspects of the immigration laws or certainly other aspects of how the government operates within the congressional law-making system and oversight.”

On immigration, specifically, Tillerson also said Trump “never asked me to violate the law,” but proposed actions that would have tested his authorities and provoked legal challenges.

“He was very action-oriented: Get it done, get it done, get it done,” Tillerson recalled. “And so just sometimes you had to say: We can’t do that.”

“I’m not a lawyer, so it wasn’t fair of me to be giving him legal advice. But I knew a bit about immigration laws. And so on occasion I would have to say to him: Well, we can’t do it that way. And I think I said, you know: It’s going to get challenged in the court and you’re going to lose,” he said.

Tillerson also described his frustrations with Jared Kushner, the president’s son-in-law and a senior White House adviser, who he said would frequently talk to foreign leaders and visit foreign countries without notifying the State Department. Along with criminal justice and immigration issues, Kushner’s broad portfolio in the administration covers U.S.-Mexico relations and the Middle East: He has spent the week in Bahrain at a U.S.-organized conference to roll out his Israel-Palestine peace plan.

“It presents special challenges to everyone if others who are trying to effect foreign policy with a country and move the agenda forward are not fully aware of other conversations that are going on,” Tillerson said.

In one example, Tillerson told the panel he was once out to dinner in Washington when he learned that the Mexican foreign secretary was in Washington — and dining with Kushner at the same restaurant.

“I could see the color go out of the face of the Foreign Secretary of Mexico,” he said. “I smiled big, and I said, ‘Welcome to Washington.'”

“As it turned out later, the Foreign Secretary was operating on the assumption that everything he was talking to Mr. Kushner about had been run through the State Department,” Tillerson continued. “He was rather shocked to find out that when he started telling me all these things that were news to me.”

“His telling to us of what life was like in that short year that he was secretary of State was very interesting,” House Foreign Affairs Committee Chairman Eliot Engel, D-N.Y., told ABC News about his meeting with Tillerson last month. “It just solidified my feeling that there was disorganization and that the president was not focused.”

Tillerson told members of the committee that Russian President Vladimir Putin was “very prepared” for his meeting with Trump in Hamburg, Germany in July 2017.

Asked if Trump was similarly prepared, Tillerson said: ““Well, we didn’t undertake that kind of preparation for the President because we didn’t expect that that’s the way it was going to go now.”

Last month, after the Washington Post first reported details of TIllerson’s testimony, Trump attacked Tillerson, calling him “dumb as a rock.”

Tillerson, accompanied by several attorneys and a State Department lawyer, also testified about his management of the State Department, and, in broad strokes, his interactions with Trump.

At an event in Houston in 2018, Tillerson called Trump “undisciplined” and someone who “doesn’t like to read.”

“I had to adapt to the fact that it wasn’t going to be useful to give him something and say this is, you know, this is an article worth reading or this is a brief,” he told the committee.

“The task for the rest of us was to learn how to operate in a way that supported him given that that’s his style. It wasn’t our job to try to change the way he does things,” he said.