We study the motivic Serre invariant of a smoothly bounded algebraic or rigid variety X over a complete discretely valued field K with perfect residue ¯eld k. If K has characteristic zero, we extend the de¯nition to arbitrary K-varieties using Bittner's presentation of the Grothendieck ring and a process of N¶eron smoothening of pairs of varieties. The motivic Serre invariant can be considered as a measure for the set of unramified points on X. Under certain tameness conditions, it admits a cohomological interpretation by means of a trace formula. In the curve case, we use T. Saito's geometric criterion for cohomological tameness to obtain more detailed results. We discuss some applications to Weil-Chatelet groups, Chow motives, and the str...