Mince garlic and anchovies and mash to a paste with a large heavy knife, then stir together with oil and rosemary in a small bowl. Pat lamb dry and transfer, fat side up, to rack in pan. Make several small 1-inch-deep slits in lamb with a paring knife, then rub marinade over entire surface of lamb, pushing some marinade into slits. Marinate lamb, loosely covered, at room temperature 1 hour.
Put oven rack in middle position and preheat oven to 400°F.
Sprinkle lamb all over with salt and pepper, then roast until thermometer inserted into thickest part of lamb (almost to the bone but not touching it) registers 125°F for medium-rare, 1 1/2 to 1 3/4 hours (temperatures in thinner parts of leg may register up to 160°F). Let stand 30 minutes before slicing.