Perhaps someone should have realized that putting sharp metal teeth next to sensitive genitalia was a bad idea.

But since the zipper's invention in 1913, the device has proven immensely popular, replacing the button fly on most trousers, jeans and pants, for men as well as women.

And now we're paying the price for the zipper's speed and efficiency at the emergency room: According to a new study from the urology journal BJU International, an estimated 17,616 people went to the ER from 2002 to 2010 with genital injuries caused by zippers.

The overwhelming majority of those were penis-related injuries, though five reported injuries were to labia or vaginas, according to MinnPost.com. And the researchers estimated most of the penis injuries were to boys and teens younger than 18 (apparently, older men learn to avoid such trauma).

In fact, of all the ways a penis can be seriously hurt, zippers were the single leading cause of penile injuries requiring an ER visit, followed by bicycle injuries — but only among adult men. [10 Wild Facts About the Male Body]

Among small boys, who apparently have the unfortunate habit of resting their penises on the lid of a toilet bowl, getting smashed by a falling toilet seat is more common than zipper injuries, according to NBC News. In a 2008 study, detailed in BJU International, scientists found that of four boys ages 2 to 4 who were treated for toilet-related penis injuries, three of the toddlers showed a build-up of fluid in the foreskin, but they were still able to urinate. The fourth had so-called glandular tenderness.

Permanent or serious damage to the penis from a zipper is rare, according to Herman Singh Bagga, a urology resident at the University of California, San Francisco and lead author of the study.

Mostly, "this is a pain issue," Bagga told NBC News. "It can completely ruin your night." In a few cases, however, zipper injuries have required surgical interventions, such as an unplanned circumcision.

In the event of a zipper-penis interaction, Bagga advises gently backing the zipper down. If that fails, Dr. Steven M. Selbst, professor of pediatrics at Jefferson Medical College in Philadelphia, advised pouring mineral oil over the snag.

"Be generous, that's the key," said Selbst, as quoted by the Huffington Post. "This is pretty cheap stuff. Then let the patient sit there for 20 or 30 minutes. When you come back, the foreskin will have simply slipped out of that zipper, although in some cases you may need a cotton swab to help it along a bit."

To avoid any cringe-inducing injuries in the first place, the UCSF researchers recommend men wear "form-fitting underwear," MinnPost.com reports. And parents should not put a boy into zippered trousers until he has the manual dexterity to avoid injuring himself.

Follow Marc Lallanilla on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on Live Science.