Although the complete genome sequences of over 50 representative species have revealed the many duplicated genes in all three domains of life, the roles of gene duplication in organismal adaptation and biodiversity are poorly understood. In addition, the evolutionary forces behind the functional divergence of duplicated genes are often unknown, leading to disagreement on the relative importance of positive Darwinian selection versus relaxation of functional constraints in this process. The methodology of earlier studies relied largely on DNA sequence analysis but lacked functional assays of duplicated genes, frequently generating contentious results. Here we use both computational and experimental approaches to address these questions in a study of the pancreatic ribonuclease gene (RNASE1) and its duplicate gene (RNASE1B) in a leaf-eating colobine monkey, douc langur. We show that RNASE1B has evolved rapidly under positive selection for enhanced ribonucleolytic activity in an altered microenvironment, a response to increased demands for the enzyme for digesting bacterial RNA. At the same time, the ability to degrade double-stranded RNA, a non-digestive activity characteristic of primate RNASE1, has been lost in RNASE1B, indicating functional specialization and relaxation of purifying selection. Our findings demonstrate the contribution of gene duplication to organismal adaptation and show the power of combining sequence analysis and functional assays in delineating the molecular basis of adaptive evolution.