A porcupine is any of 23 species of rodent belonging to the families Erethizontidae and Hystricidae. All defend themselves with sharp spines (which are actually modified hairs) rather like those of the hedgehogs, which are part of the order Insectivora and more closely related to shrews and moles than they are to the rodents, and the echidnas, which as monotremes are very distantly related indeed.
Porcupines occupy a wide range of habitats in tropical and temperate parts of Asia, Italy, Africa and the Americas and vary in size considerably: Rothschild's Porcupine of South America weighs less than a kilo; the African Porcupine can grow to well over 20 kilos.
The two families of porcupines are quite different and although both belong to the Hystricognathi branch of the vast order Rodentia, they are not closely related.
The 11 Old World porcupines are almost exclusively terrestrial, tend to be fairly large, and have quills that are grouped in clusters. They separated from the other hystricognaths about 30 million years ago, much earlier than the New World porcupines.
The 12 New World porcupines are mostly smaller (although the North American Porcupine reaches about 85 cm in length and 18 kilos), have their quills attached singly rather than grouped in clusters, and are excellent climbers, spending much of their time in trees. The New World porcupines developed their spines independently, and are more closely related to several other families of rodent than they are to the Old World porcupines.
In parts of Africa, porcupines are eaten as a form of bush meat.