He spoke after The New York Times quoted unnamed US officials as saying that Israel had carried out a large military exercise this month that appeared to be a rehearsal for a potential bombing attack on Iran's nuclear facilities.
Obama, a Democrat who is running against Republican John McCain in the November election, was asked at a news conference in Jacksonville, Florida whether Israel was right to carry out the exercise.
"Without access to the actual detailed intelligence, I want to be careful about characterizing what was done and whether it was appropriate or not," Obama, an Illinois senator, said.
But he added that the Jewish state was right to be concerned about the anti-Israel comments of Iranian President Mahmoud Ahmadinejad and about Tehran's support for Hizbullah and Hamas.
"And so there is no doubt that Iran poses an extraordinary threat to Israel and Israel is always justified in making decisions that will provide for its security," Obama said.
The Times said more than 100 Israeli F-16 and F-15 fighters took part in the maneuvers over the eastern Mediterranean and Greece in the first week of June.
It said the exercise appeared to be an effort to focus on long-range strikes and illustrates the seriousness with which Israel views Iran's nuclear program.
Israel's ambassador to the United States, Sallai Meridor, also talked of the threat posed by Iran in an interview with CBS News.
"We cannot take this threat lightly and as our prime minister recently said Israel will not tolerate a nuclear Iran," Meridor told the US television network.
Asked how much time was left before the diplomatic window closes, Meridor replied, "Less today than we had yesterday, and it's, it's running out."