James Comey's testimony before the Senate Intelligence Committee raises questions about whether President Donald Trump obstructed justice by firing his FBI director, said former Assistant Attorney General John Carlin.

"Whether or not someone obstructs justice ... you look at their intent: Were they corruptly trying to influence an investigation?" Carlin told CNBC's "Squawk Box" on Thursday.

During Barack Obama's administration, Carlin was assistant attorney general for national security and was chief of staff to Robert Mueller when the latter was FBI director. Last month, Mueller was appointed by the Justice Department as special counsel in charge of the investigation into allegations that Russia interfered with the 2016 election. Mueller is largely viewed as bipartisan since he also served as FBI director during George W. Bush's presidency.

Carlin described Comey's scheduled appearance before the Senate committee on Thursday morning is a "historical event."

In written testimony released Wednesday, Comey recounted an interaction with Trump in which the president allegedly said "I need loyalty." Comey also described a request from Trump to "lift the cloud" of the Russian inquiry. But the former FBI director also confirmed he told the president three times he was not under investigation.

"You got to look at it all together as a package," said Carlin. "All these acts together — including and most significantly firing the man in charge of the investigation — was [Trump] doing that because he wanted to influence the investigation because he didn't like the way it was going?"

Trump's personal lawyer Marc Kasowitz said, "The president is pleased that Mr. Comey has finally publicly confirmed his private reports that the president was not under investigation in any Russian probe." The statement also said, "The president feels completely and totally vindicated. He is eager to continue to move forward with his agenda."

"There's nothing wrong with the president meeting with the FBI director," said John Malcolm, a former deputy assistant attorney general under President George W. Bush.