The structure of messenger RNA is important for post-transcriptional regulation, mainly because it affects binding of trans-acting factors. However, little is known about the in vivo structure of full-length mRNAs. Here we present hiCLIP, a biochemical technique for transcriptome-wide identification of RNA secondary structures interacting with RNA-binding proteins (RBPs). Using this technique to investigate RNA structures bound by Staufen 1 (STAU1) in human cells, we uncover a dominance of intra-molecular RNA duplexes, a depletion of duplexes from coding regions of highly translated mRNAs, an unexpected prevalence of long-range duplexes in 3' untranslated regions (UTRs), and a decreased incidence of single nucleotide polymorphisms in duplex-forming regions. We also discover a duplex spanning 858 nucleotides in the 3' UTR of the X-box binding protein 1 (XBP1) mRNA that regulates its cytoplasmic splicing and stability. Our study reveals the fundamental role of mRNA secondary structures in gene expression and introduces hiCLIP as a widely applicable method for discovering new, especially long-range, RNA duplexes.