The Islamic Jihad group said it had launched four rockets from northern Gaza toward Israeli towns a few minutes earlier.
Witnesses said the two teenagers went to retrieve the launcher after the rockets were fired.
An Israeli army spokeswoman said Israeli forces opened fire on Palestinians who had just launched three rockets into Israel.
Earlier on Wednesday in the occupied West Bank, an Israeli soldier was shot and injured while driving near a Jewish settlement, ambulance services said.