The thermodynamic stability of certain mismatched base pairs has made the development of DNA sequence sensing systems challenging. Thus, the stability of fully matched and mismatched DNA oligonucleotides in the hydrated ionic liquid choline dihydrogen phosphate (choline dhp) was investigated. Mismatched base pairs were significantly destabilized in choline dhp relative to those in aqueous buffer. A molecular beacon that forms a triplex with a conserved HIV-1 sequence was then designed and tested in choline dhp. The molecular beacon specifically detected the target duplex via triplex formation at concentrations as low as 1 pmol per 10 $\mu$L with 10000-fold sequence selectivity. Moreover, the molecular beacon was protected from a contaminating nuclease in choline dhp and DNAs in aqueous solutions were not sufficiently stable for practical use.