this disclosure concerns a semiconductor device comprising a switching transistor provided on a semiconductor substrate ; an interlayer dielectric film formed on the switching transistor ; a ferroelectric capacitor including an upper electrode , a ferroelectric film , and a lower electrode formed on the interlayer dielectric film ; a contact plug provided within the interlayer dielectric film and electrically connected to the lower electrode ; a diffusion layer connected to between the contact plug and the switching transistor ; a barrier metal covering a whole upper surface of the upper electrode ; and an insulation sidewall film provided on a side surface of the barrier metal and provided substantially on a same plane as a side surface of the upper electrode .