We determined the focal-mechanism solutions for earthquakes with magnitude ML≥4.0 that occurred in the Taiwan region between 1991 and 2005. First-motion polarities of P waves recorded at over 700 seismic stations in Taiwan were used. Because of the large number of events and stations involved, we implemented the genetic algorithm in a nonlinear global search for the focal-mechanism solutions. The algorithm was tuned and validated through synthetic tests. We finally determined the focal mechanisms of 1635 events with good qualities among 4188 earthquakes. Focal-mechanism solutions for a majority of the earthquakes display a dominant pattern of thrust-fault type reflecting the compressive stress field due to the plate collision. Normal-fault events occurred at intermediate depths in subduction zones, which is likely the result of the bending of the subducting slabs. Strike-slip faults are also found within the Eurasia plate around the Peikang Basement High and in collision zones near Ilan where the geometry of the colliding plates is complex. Our study provides a database of focal mechanisms for studying seismogenic structures and plate tectonics. This database can also be used by structural seismologists to compute synthetics for waveform tomography studies.