Learning a spoken language presupposes efficient auditory functions. In the present event-related potential study, we tested whether and how basic auditory processes are related to online learning of a linguistic rule in infants and adults. Participants listened to frequent standard stimuli, which were interspersed with infrequent pitch deviants and rule deviants, violating a nonadjacent dependency between two syllables. Only infants who showed the more mature mismatch response for the pitch deviants (i.e., a negativity) showed a mismatch response to the rule deviants. Concordantly, the small group of adults who showed evidence of rule learning showed larger mismatch effects for pitch processing. We conclude that the ability to extract linguistic rules develops in early infancy and is tightly linked to functional aspects of basic auditory mechanisms.