One fundamental property of voluntary action is the feeling of control and causation, also referred to as self agency. Recent research suggests that the sense of agency is based on low-level, sensory-motor control processes, which compare predicted and actual action-effects. Brain imaging research revealed that the temporo-parietal junction (TPJ) plays a crucial role for signalling whether a sensory action-consequence matches the prediction or not. However, while it was assumed that sensory outcome predictions are based on ideomotor (action-effect) learning, it has rarely been investigated whether such learning can lead to a sense of agency. In this functional MRI experiment we tested whether a sense of agency develops from learning action-effect associations. In the first part of the experiment, participants learned new action-effect associations. During the following scanning session participants were exposed to matching and non-matching action-effects. In accordance with previous behavioural research, participants reported a decreased sense of agency for non-matching events. As predicted, activity in the TPJ increased with greater incongruence between predicted and actual sensory effects. Furthermore, attributing the causation of sensory events to another person was correlated with activity in fronto-median cortex, a region involved in the representation of intentional agents. This relationship was modulated by the external attribution disposition of the participants. Complementing our view on agentive processes, our findings indicate that ideomotor learning provides an essential basis for the distinction of agents' behaviour and also point to a possible high-level contribution of prefrontal cortex and personality traits to the sense of agency.