Officials say state police fatally shot a man armed with a rifle who had barricaded himself inside a New Hampshire bed-and-breakfast for about 10 hours.