Octopuses evolved, most likely, from early gastropods and evolved arms and legs from what used to be funnels, their horn-shaped shells, and then grew an extra pair of arms for hunting, according to Sea Friends. It's not true that octopuses have eight legs; they actually have six legs and two arms.
The first cephalopods evolved around 500 million years ago, according to Softpedia. Octopuses themselves evolved near the end of the Cretaceous era and used to be very small at only around 8 cm long. Now, there are around 289 species of octopuses, and the largest averages around 10 feet long.
Interestingly, the male octopus has a penis made from its third arm on the right. This arm is called a hectocotylus and can detach during mating. During the mating season, a male octopus may have only seven legs due to the loss of its third arm. He grows a new one the next season.
Although he can grow his arm back, mating octopuses usually only mate once in a lifetime. At that time, the female produces between 100 to 500,000 eggs. The female octopus fasts while caring for her eggs, and she dies when her offspring hatch, since she has been starved. Female octopuses are expected to live for only one to two years, while males can live up to five.