A scanning Hall probe microscope is used to study flux pinning in a thin su
perconducting Pb film covering a square array of single-domain Co dots with
in-plane magnetization. We show that single flux quanta of opposite sign t
hread the superconducting film below T-c at the opposite poles of these dip
oles. Depending on the polarity of the applied field, flux lines are attrac
ted to a specific pole of the dipoles, due to the direct interaction with t
he vortexlike structures induced by the local stray field.