The use of host resistance (R) genes is considered the most cost-effective option to control the rice blast disease. The two allelic R genes Pi2 and Pi9 confer very broad-spectrum resistance against blast isolates collected worldwide. However, the two genes have not yet been widely deployed in rice breeding programmes. Availability of specific markers for them would facilitate incorporating the two R genes into new rice lines through marker-assisted selection. Herein, we report the development and utilization of a robust and specific marker for the Pi2 and Pi9. This marker was derived from polymorphisms within the target gene, and achieved simultaneously distinguish Pi2 and Pi9 from other alleles through high-resolution melting of a small amplicon. With the marker, we were able to transfer the Pi2 into an elite restorer line through marker-assisted backcrossing, successfully obtained effective resistance to blast disease, and we were also able to, respectively, incorporate the Pi2 and Pi9 with two other R genes. As the additive effect, blast resistance in these stacking lines harbouring three R genes were significantly improved.