Actor Sean Penn said he was warned against going into Ukraine to film a documentary while the country was at the brink of war with Russia and that he was later told to "get the f--- out."

"I just heard from [Former National Security Adviser] Robert O'Brien and he said to get the f--- out," Penn said in an interview that aired on "Special Report" Monday. 

The segment featured a panel discussion between Penn, O'Brien, and was moderated by Fox News host Bret Baier at The Richard Nixon Presidential Library & Museum in Yorba Linda, California. 

Penn described being warned not to go to Ukraine. "Our government is extremely good at caution. American diplomats had been pulled out of and other Foreign Service officers pulled out of Kyiv. [People said,] 'Don't go. There's nobody there. There'll be no calvary and so on.'"

He continued, "I was speaking to Robert [O'Brien] the whole time here. He knows the region much better than I do, and I made it. We … calculated that it would be fine, whatever happened. I don't think anybody wanted to give up a level of denial that [the war] would happen because they would be giving up hope that [the invasion] wouldn't happen."

The Oscar-winning actor then described meeting Ukrainian President Volodymyr Zelenskyy and how he witnessed in a short period of time how the "world had changed."

"We met with [Zelenskyy], a man in a suit, and the next morning the Russians invaded. We went back. We were with President Zelensky and waited for him at a meeting point. And the next time I saw him, he was in camos and the world had changed," he said.