Reciprocity, responding to another one’s actions with similar actions, is central to the formation and maintenance of relationships. Reciprocity and relationship formation change with children’s development and are key aspects in human-robot interaction. So far, it is unclear how children reciprocate and build a relationship with a social robot and how reciprocity to social robots develops with age. In the current preregistered study, we collected data from 147 children aged 5 to 12 years to investigate the developmental trajectory of reciprocity towards a social robot and the formation of a relationship with this robot. To test reciprocity, children completed an Alternated Repeated Ultimatum Game with a social entertainment robot and another child. A recently validated survey on relationship formation was used that assesses trust, closeness, and social support. Results from a linear-mixed effects Bayesian analysis indicated that children reciprocated similarly to a robot as to another child. While reciprocity differed across age with lower values for 8-10-year-olds compared to younger and older children, this difference in the developmental trajectory of reciprocity was also observed when children interacted with the robot. Exploratory analysis showed differing results for positive (reciprocating positive actions with positive actions) and negative reciprocity (reciprocating negative actions with negative actions). Children’s relationship formation with a social robot changed with age but showed different developmental trajectories for trust (linear), closeness (negative quadratic), and social support (constant). No association was found between reciprocity towards the robot and relationship formation. Our findings suggest that established theories from human-human literature, such as the developmental trajectory of reciprocity, are also relevant for human-robot interaction. Children’s age is an important determinant for how children interact with and perceive robots. This therefore needs to be considered when designing robotic systems and experiments in the future as it could influence the success and effectiveness of both.