The present invention relates to thienopyrimidine compounds which are potassium channel inhibitors. Pharmaceutical compositions comprising the compounds and their use in the treatment of arrhythmia are also described.Compuestos de tienopiridimidina que son inhibidores de canal de potasio. Composiciones farmacéuticas que comprenden los compuestos y su uso en el tratamiento de arritmia.