Expression QTLs (eQTLs), provide valuable information on the functional effects of variants. Many methods have been developed to leverage eQTLs to nominate candidate genes of complex traits. These methods include colocalization analysis, transcriptome-wide association studies (TWAS) that correlate genetic components of expression with traits, and Mendelian Randomization (MR)-based methods. A fundamental problem of all these methods is that, when assessing the role of one gene in a trait using its eQTLs, nearby variants and nearby genetic components of expression of other genes can be correlated with the eQTLs of the test gene, while affecting the trait directly. These "genetic confounders" may lead to false discoveries. To address this challenge, we introduced a novel statistical framework that generalizes TWAS to adjust all genetic confounders. In our simulations, we found that existing methods based on TWAS, colocalization or MR all suffered from high false positive rates, often greater than 50%. Our method, causal-TWAS (cTWAS), in contrast, showed calibrated false positive rates while maintaining power. Application of cTWAS on several common traits highlighted the weakness of existing methods and discovered novel candidate genes. In conclusion, cTWAS is a robust statistical framework to integrate eQTL and GWAS data for gene discovery, and is extendable to other molecular QTLs.