We present fully dynamic algorithms for maintaining 3- and 5-spanners of undirected graphs under a sequence of update operations. For unweighted graphs we maintain a 3or 5-spanner under insertions and deletions of edges; each operation is performed in O(n) amortized time over a sequence of Ω(n) updates. The maintained 3-spanner (resp., 5-spanner) has O(n3/2 ) edges (resp., O(n4/3 ) edges), which is known to be optimal. On weighted graphs with d different edge cost values, we maintain a 3- or 5-spanner in O(n) amortized time over a sequence of Ω(d · n) updates. The maintained 3-spanner (resp., 5-spanner) has O(d · n3/2 ) edges (resp., O(d · n4/3 ) edges). The same approach can be extended to graphs with realvalued edge costs in the range [1, C]. All our algorithms are deterministic and are substantially faster than recomputing a spanner from scratch after each update.