CIA director and secretary of state nominee Mike Pompeo on Thursday said he wouldn't rule out the option of a military strike or even ground invasion against North Korea if that action were necessary to protect the United States, an answer that unnerved Sen. Ed Markey, D-Mass.

At Pompeo's nomination hearing at the Senate Foreign Relations Committee, Markey said he's worried that some in the Trump administration could push for a military invasion if North Korea refuses to dismantle its nuclear weapons program. He asked him whether there would be any reason to launch a first strike against North Korea.

Pompeo stressed that there's still lots of diplomacy to conduct with North Korea.

"To your point, we have not yet exhausted our capacity there," he said. "I think there's an awfully long way to go."

But he also said it's conceivable that military action is needed.

"There may come the day when we see an arsenal of nuclear weapons, capable of striking the United States of America," he said. "The president has made clear his intention to prevent that from happening, and to the extent that diplomatic tools and other tools that America has as its foreign policy power are unsuccessful, I know that Secretary Mattis has been directed to present to the president a set of options that will achieve the president's objective."

Markey then pressed Pompeo on whether he could imagine a scenario in which he would support a ground invasion of North Korea.

"Could I imagine one? Yes, yes senator, I could," he said, agreeing to hypothesize about possible scenarios. "I suppose it's possible that we would get to the condition where, and I think there'd be wide consensus on this panel, where Kim Jong Un was directly threatening and we had information about his activities, yes I can imagine times when America would need to take a response that moved past diplomacy."

But Pompeo stressed again he's not looking for that outcome. When Markey said such an invasion would be "catastrophic" because North Korea already has nuclear weapons, Pompeo interjected, "I agree with that."

But Markey was still left worried by the answer, and said he was already worried given John Bolton's new job as President Trump's national security adviser.

"I think the American people will want reassurances, you know, from you, that you would not consider such an action, because ultimately, he already has nuclear weapons, and it would be catastrophic almost immediately if we decided to make a first strike against them," he said.

"So I don't feel comfortable with you not taking that off the table," Markey added.