A suicide bomber drove his explosive-laden car into al-Kifah primary school in the city of Hit, some 160 km west of the capital Baghdad, killing two pupils and a female teacher and wounding 14 others, the source said on condition of anonymity.
Iraqi security forces sealed off the scene as ambulances and civilian cars evacuated the casualties, the source said.
The blast caused severe damages to the school building and nearby buildings, the source added.
The attack came as the schools in Iraq started their second day of the new school year after about three months of summer holiday.
Insurgent attacks continue in the once volatile Sunni Arab area in west of Baghdad that stretches through Anbar province to Iraq's western borders with Syria, Jordan and Saudi Arabia.