This thesis presents combined experimental and theoretical investigations of nanoscale, surface-supported magnets based on rare earths (RE) to understand and control the magnetic properties down to the scale of single atoms. We present the effects of adatom-substrate interaction on the magnetic properties of isolated single RE atoms using x-ray absorption spectroscopy (XAS), x-ray magnetic circular dichroism (XMCD), and multiplet analysis. Our systematic investigations of Dy, Ho, Er, and Tm adatoms adsorbed on Pt(111), Cu(111), Ag(100), and Ag(111), reveal that the REs can possess two types of 4f occupations, namely divalent 4f^n and trivalent 4f^(n-1). The trivalent state is realized in presence of low promotion energy of the RE and strong hybridization of their external spd shell with the surrounding environment. Notably, none of the REs exhibit magnetic hysteresis, suggesting that magnetic relaxation is faster than about 10 seconds. We also report on the effect of adatom-adatom interaction by studying the size-dependent magnetic properties of Er clusters adsorbed on Cu(111). Combining XMCD, scanning tunneling microscopy (STM), and mean-field nucleation theory we reveal that the adatom-adatom interaction dominates over the adatom-substrate interaction in Er clusters starting from the size of three atoms. Consequently the easy axis of Er changes from in-plane for the single atoms and dimers to out-of-plane for trimers and bigger clusters. In addition, the out-of-plane magnetic anisotropy of 2.9 meV/atom results in magnetic hysteresis at 2.5 K in all clusters starting from trimers. With a magnetic lifetime of approximately 2 minutes at 0.1 T, the Er trimers are one of the smallest metal-supported ferromagnetic clusters observed so far. The investigation of adatom-adatom interaction is further extended by studying 4f-3d heterodimers namely, Ho-Co adsorbed on thin insulating layers of MgO. Their magnetic easy axis is oriented out-of-plane. Using spin-polarized STM we have detected spin-excitations in these heterodimers at ±20 and ±8 meV. We have identified the origin behind these spin-excitations using an effective spin Hamiltonian model, which indicates that, given a ferromagnetic exchange interaction between Ho and Co, the most intense feature at ±20 meV corresponds to a transition in which the spin moment of Co is strongly diminished. This is further accompanied by an overall change of the total magnetic moment of the heterodimer, i.e., ¿J=-1. In contrast, the weaker transition at ±8 meV occurs following a change in the out-of-plane moment of Ho while the total moment of the heterodimer remains intact i.e., ¿J=0. Notably, we observe an effective g factor of 3.1 for the ±20 meV transition, which significantly exceeds the free electron value of 2. In addition, the ferromagnetic coupling between Ho and Co is very unusual compared to the ferrimagnetic exchange interaction known for the bulk 4f-3d compounds, especially those derived from the late lanthanides. Nonetheless, this marks the first evidence of spin-excitations in the smallest 4f containing cluster. The knowledge gained on the fundamental aspects of magnetism in surface-supported REs combined with the continued parallel search for magnetic stability down to single atoms, enabled us to achieve magnetic remanence in single adatoms with lifetimes of the order of 1000 s at 2.5 K. In addition we have achieved significantly enhanced hysteresis and magnetic lifetime in TbPc2.