Two rockets fired from the Gaza Strip landed on Thursday in a southern Israeli border town that U.S. President Barack Obama mentioned in a speech on his arrival in Israel a day earlier.
Police said there were no casualties but some damage in the attack on Sderot near the Gaza frontier.
There was no immediate claim of responsibility for the strike, the second time rockets launched from Gaza have hit Israel since a truce ended an eight-day cross-border war in November.
As a presidential candidate in 2008, Obama visited Sderot, meeting locals and viewing an exhibit of rocket remnants from frequent attacks by Gaza-based militants.
"I've stood in Sderot, and met with children who simply want to grow up free from fear. And flying in today, I saw again how Israel's security can be measured in mere miles and minutes," Obama told a news conference in Jerusalem on Wednesday.
Obama is on a three-day visit to Israel, the occupied West Bank and Jordan. He will not travel to Gaza, which is ruled by Hamas, a group sworn to Israel's destruction.
The president was in Jerusalem, some 80 km (50 miles) from Sderot, when the rockets struck several hours before his visit to the West Bank city of Ramallah for talks with Hamas's rival, Western-backed Palestinian Authority President Mahmoud Abbas.
"We condemn violence against civilians regardless of its source, including rocket firing," Abbas was quoted as saying by the official Palestinian Wafa news agency.
"We are in favor of maintaining mutual and comprehensive calm in Gaza," he added.
At Tel Aviv airport on Wednesday, Obama inspected an Iron Dome anti-missile battery, a partially U.S.-funded system that has been used to shoot down rockets fired from the Gaza Strip.
Reporting by Ori Lewis, Editing by Jeffrey Heller