The North American porcupine (Erethizon dorsatum) is the second-largest rodent in North America, beat out only by the beaver, according to the University of Michigan, Museum of Zoology.

Porcupines are well known for their pointy quills, which cover their backs, sides and tail to provide a natural protection against predators. But do these quills also make mating difficult for the large rodents? Just how do porcupines do it?

Porcupines can be broadly divided into the Old World and New World varieties, which are quite different from each other in terms of ecology and social structure.

New World porcupines, including the well-studied North American porcupine (Erethizon dorsatum), live in trees and eat leaves, fruits and bark. Old World porcupines live on the ground (such as in caves) and feed on fruit, roots and bulbs. And New World porcupines are generally solitary animals, whereas Old World porcupines live in family groups.

The two types of porcupines also have very different mating systems. [Animal Sex: 7 Tales of Naughty Acts in the Wild]

Old World porcupines are one of the few animals on the planet that are monogamous. An adult pair will form lifelong partners and breed several times each year (pregnancies last only about 90 days), said porcupine expert Uldis Roze, author of "The North American Porcupine" (Comstock Publishing Associates, 2009) and "Porcupines: The Animal Answer Guide" (Johns Hopkins University Press, 2012).

Female North American porcupines, on the other hand, are only fertile once a year for a period of eight to 12 hours (little is known about the mating behaviors of other New World porcupines). "As a matter of fact, they are so sexually inactive that the vagina is usually closed with a membrane," Roze told Live Science.

In September, that vaginal closure membrane dissolves. The female then begins secreting odorous vaginal mucus, which, along with her urine, lures males into her territory. But when the first male arrives, the female is still not ready to ovulate, so he has to wait — this gives time for other males to find her, too. The males will then engage in vicious battles, which can result in scars, missing ears and other injuries, Roze said.

The victorious male will guard the female by sitting on a lower branch of her tree, allowing him to intercept any other approaching males. Eventually, he will stimulate her to go into estrous by urinating on her.

"But this is not the kind of urination you have when your bladder is full," Roze said. Instead, the urination is similar to ejaculation. "It's a high-speed projectile that launches drops of urine from one tree branch to another."

The female will make it known if she's not receptive to the male's come-ons by screaming at him, shaking the urine off and running away. She may also be hostile and try to bite or tail-swipe him if he doesn't get the hint. "The male has to respect [her decision] — the female cannot be raped," Roze said.

When the female is ready to mate, she'll present her hindquarters and curve her tail over her back so that her quills don't impale the male. She'll also lay the rest of her quills flat against her body, allowing the male to mount her briefly with little danger.

The pair will mate a few more times until the female has had enough and she moves away from him. The male will quickly leave to find more mates; the female will spend the next seven months pregnant, and the following four months nursing her newborn baby, before it's time to start the mating game all over again.

Interestingly, Old World porcupines mate again soon after the female gives birth. "But it’s a sterile mating, and no baby is produced," Roze said. "It's probably a way of keeping the family system intact."

Follow Joseph Castro on Twitter. Follow us @livescience, Facebook & Google+.