This paper analyzes the impact of corruption on bilateral trade flows, highlighting the dual role of corruption in terms of extortion and evasion. On one hand, corruption taxes trade, when corrupt customs officials in the importing country extort bribes from exporters (the extortion effect), on the other, if tariffs are high, corruption may be trade enhancing, when the corrupt officials allow exporters to evade tariff barriers (the evasion effect). The paper derives and estimates a corruption-augmented gravity model that shows that the effect of corruption on trade flows is ambiguous and is contingent on the level of tariffs. The predictions are borne out in the data: corruption taxes trade in the majority of cases, but in high tariff environments (covering 5-14% of the observations,) its marginal effect is trade-enhancing.