About two months ago, Dr. Elizabeth Stier was shocked to learn that she would lose a vital credential, board certification as a gynecologist, unless she gave up an important part of her medical practice and her research: taking care of men at high risk for anal cancer.

The disease is rare, but it can be fatal and its incidence is increasing, especially among men and women infected with H.I.V. Like cervical cancer, anal cancer is usually caused by the human papillomavirus, or HPV, which is sexually transmitted.

Though most of her patients are women, Dr. Stier, who works at Boston Medical Center, also treated about 110 men last year, using techniques adapted from those developed to screen women for cervical cancer.

But in September, the American Board of Obstetrics and Gynecology insisted that its members treat only women, with few exceptions, and identified the procedure in which Dr. Stier has expertise as one that gynecologists are not allowed to perform on men. Doctors cannot ignore such directives from a specialty board, because most need certification to keep their jobs.