If he had wanted to, former President Barack Obama could have ordered a wiretap on then-presidential candidate Donald Trump — or on any American he wanted to, Judge Andrew Napolitano said Tuesday.

"If [President] Donald Trump wanted to, he could surveil anybody," the Fox News senior judicial analyst told "Fox & Friends."

"That's directly in the FISA (Federal Intelligence Surveillance Act) statute, which after laying out a lot of detailed procedures about what the NSA (National Security Agency) is supposed to do says literally, notwithstanding all of the above, the president of the United States may on his own conduct surveillance or order surveillance of any person in the United States upon the filing of a certification with the attorney general, who of course works for the president."

There have been many people commenting it would have been illegal for Obama to listen to Trump's phone calls from Trump Tower, and to the eventual president's in-person conversations, but that is not true, Napolitano said.

"In my view, it's immoral, and profoundly unconstitutional, and utterly wrong, but it's lawful because Congress has said it is lawful," Napolitano said. "This was power given to every president from Jimmy Carter up to and including Donald Trump."

The power was not intended for presidents to spy on political enemies, Napolitano said, but "the language is so broad, that it would authorize it."

"The last thing in the world the intelligence community wants is an investigation by Congress, which will expose how truly pervasive spying is," Napolitano said. "The intelligence community captures everything we say on our mobile devices. Every time we touch a key on our mobile devices, on our desk tops, every conversation on land line, every piece of data that goes across any fiber in the United States into or out of the United States is captured digitally by the NSA."

The NSA, he continued, is in the military, and Obama could have told the military he needed a Trump conversation, and he would have had it in minutes.

Further, he said, while former Director of National Intelligence James Clapper came out with a denial, "he chose his words very carefully."

"He said if somebody got a FISA warrant about this, I would know about it," Napolitano said. "The president doesn't need a FISA warrant. The statute authorizes the president to bypass FISA. And quite frankly, we are all skeptical of anything James Clapper says because he lied under oath."

FBI Director James Comey has also been caught in the middle of the controversy, because the FBI "doesn't use FISA," but does investigate crimes, and needs to get warrants to gather evidence. Further, Napolitano said, the FBI would not have been watching Trump Tower unless it believed crimes were happening there.