WASHINGTON — After years of debate about the health risks of electronic cigarettes, the federal government on Thursday made it final: They need to be regulated and kept out of the hands of children.

The Food and Drug Administration issued sweeping new rules that for the first time extend federal regulatory authority to e-cigarettes, banning their sale to anyone under 18 and requiring that adults under the age of 26 show a photo identification to buy them.

The long-awaited regulations, 499 pages of them, shifted the terms of the public debate over e-cigarettes, putting the federal government’s heft behind a more restrictive approach to the devices. Many health experts fear that e-cigarettes will eventually hook a new generation on traditional cigarettes, while others worry that a tougher approach will make it harder for addicted smokers to get access to devices that may be their best hope of quitting.

“We’ve agreed for many years that nicotine does not belong in the hands of children,” Sylvia Mathews Burwell, the secretary of the Department of Health and Human Services, said at a news conference on Thursday. “Progress has been made, but the context has changed so we need to act.”