Spokesman Micky Rosenfeld says one rocket exploded in the courtyard of a house in the border town of Sderot, causing damage but no injuries. The other landed in an open field.
As a presidential candidate in 2008, Obama visited Sderot, which is frequently targeted by rocket attacks from the nearby Gaza Strip. The territory is ruled by the militant Palestinian Hamas group.
No group immediately claimed responsibility for Thursday's attack, which came as Obama was in Jerusalem. He is to visit the West Bank city of Ramallah later in the day.