We investigate the nucleation of superconductivity in an Al film deposited on top of an array of micromagnets with perpendicular anisotropy by dc transport measurements. The absolute control of the magnetic state of the ferromagnets enabled us to explore the superconductor-normal-metal phase boundary as a function of the magnetization M of the dots. For a given external homogeneous field H, the magnetization of the dots can be tuned in such a way to optimize the field and current compensation in the sample, thus yielding a clear enhancement of the upper critical field H c2 . In addition, we theoretically demonstrate that the critical current I c for a given temperature could be further enhanced by properly adjusting the size of the magnetic dots. These results are fully corroborated by the Ginzburg-Landau theory as well as analytic estimates. DOI: 10.1103/PhysRevB.76.100502 PACS number͑s͒: 74.78.Fk, 74.25.Dw, 74.25.Fy Controlling the critical parameters of superconductors has been a long pursued objective of condensed matter physicists.1 Arguably among the most relevant of these goals is the increase of the critical field below which superconductivity nucleates. For a given material this effect can be achieved by doping the starting compound in such a way that the electronic mean free path ᐉ becomes smaller than the superconducting coherence length ͑Ref. 2͒ or by nanopatterning the material in order to promote surface superconductivity.3 Both cases manifest themselves as an enhancement of the upper critical field by a field-independent factor which is determined by either ᐉ or the geometrical details of the nanostructuring.An alternative way of preventing the deterioration of the superconducting state under external magnetic fields consists of locally counteracting the applied field by introducing an array of micrometer-sized paramagnets with high magnetic susceptibility. 4 In this case superconductivity would nucleate in the interstitial position between neighboring paramagnets where the returning stray field of the magnetic elements nearly compensates the external field, 5 and thus higher fields than in normal conditions could be sustained. 6 A very close approximation to this situation can be achieved by using a periodic array of ferromagnets with a tunable magnetic moment m aligned with the applied field H. In this case, unlike for the paramagnets, by changing the polarity of the magnetic moments of the dots one can counteract the external homogeneous field either above ͑m and H antiparallel͒ or in between the magnetic elements ͑m and H parallel͒.7 These field-compensation effects can lead to a substantial increase of the upper critical field in a field-temperature region determined by the magnetization of the dots.In this work, we study the field compensation effects in an Al thin film evaporated on top of a square array of Co/ Pt microdots with tunable out-of-plane magnetization. The selected materials give rise to a sizable difference between the magnetic and superconducting characteristic energies wh...