Bacillus anthracis has posed a threat of becoming biological weapons of mass destruction due to its virulence factors encoded by the plasmid-borne genes, such as lef for lethal factor. We report the development of a fast and sensitive anthrax DNA biosensor based on a photonic crystal structure used in a total-internal-reflection configuration. For the detection of the lef gene, a single-stranded DNA lef probe was biotinylated and immobilized onto the sensor via biotin-streptavidin interactions. A positive control, lef-com, was the complementary strand of the probe, while a negative control was an unrelated single-stranded DNA fragment from the 16S rRNA gene of Acinetobacter baumannii. After addition of the biotinylated lef probe onto the sensor, significant changes in the resonance wavelength of the sensor were observed, resulting from binding of the probe to streptavidin on the sensor. The addition of lef-com led to another significant increase as a result of hybridization between the two DNA strands. The detection sensitivity for the target DNA reached as low as 0.1 nM. In contrast, adding the unrelated DNAs did not cause an obvious shift in the resonant wavelength. These results demonstrate that detection of the anthrax lef by the photonic crystal structure in a total-internal-reflection sensor is highly specific and sensitive.