We use the spectral-element method to simulate strong ground motion throughout the Taipei metropolitan area. Mesh generation for the Taipei basin poses two main challenges: (1) the basin is surrounded by steep mountains, and (2) the city is located on top of a shallow, low-wave-speed sedimentary basin. To accommodate the steep and rapidly varying topography, we introduce a thin high-resolution mesh layer near the surface. The mesh for the shallow sedimentary basin is adjusted to honor its complex geometry and sharp lateral wave-speed contrasts. Variations in Moho thickness beneath Northern Taiwan are also incorporated in the mesh. Spectral-element simulations show that ground motion in the Taipei metropolitan region is strongly affected by the geometry of the basin and the surrounding mountains. The amplification of ground motion is mainly controlled by basin depth and shallow shear-wave speeds, although surface topography also serves to amplify and prolong seismic shaking.